Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateDescriptorRaw ¶
func GenerateDescriptorRaw(introductionPoints []IntroductionPoint, publishedTime time.Time, replica byte, deviation uint8, descriptorCookie string, permanentKey *rsa.PublicKey, privateKey *rsa.PrivateKey, permID []byte, descriptorID []byte) ([]byte, error)
GenerateDescriptorRaw generates a raw signed hidden service descriptor
Types ¶
type HiddenServiceDescriptor ¶
type HiddenServiceDescriptor struct { DescriptorID string Version int PermanentKey string SecretID string Published time.Time ProtocolVersions []int IntroductionPointsRaw string IntroductionPoints []IntroductionPoint Signature string }
HiddenServiceDescriptor represents a v2 hidden service descriptor as defined in https://github.com/torproject/torspec/blob/master/rend-spec-v2.txt
func ParseHiddenServiceDescriptor ¶
func ParseHiddenServiceDescriptor(descriptorRaw string) (*HiddenServiceDescriptor, error)
type IntroductionPoint ¶
type IntroductionPoint struct { Identifier string Address net.IP Port int OnionKey string ServiceKey string Raw string }
IntroductionPoint represents a introduction point
type IntroductionPointsIterator ¶
type IntroductionPointsIterator struct {
// contains filtered or unexported fields
}
IntroductionPointsIterator is a stateful iterator for introduction points
func NewIntroductionPointsIterator ¶
func NewIntroductionPointsIterator(introductionPoints [][]IntroductionPoint) *IntroductionPointsIterator
NewIntroductionPointsIterator returns a new NewIntroductionPointsIterator
func (*IntroductionPointsIterator) Next ¶
func (ips *IntroductionPointsIterator) Next() []IntroductionPoint
Next returns the next IntroductionPoint in the cycle
type RouterFlags ¶
type RouterFlags struct { Authority bool BadExit bool Exit bool Fast bool Guard bool HSDir bool Named bool Stable bool Running bool Unnamed bool V2Dir bool Valid bool }
RouterFlags represents the possible flags a router status can have
type RouterStatusEntry ¶
type RouterStatusEntry struct { Nickname string Fingerprint string Digest string Published time.Time Address net.IP ORPort int DirPort int Flags RouterFlags Version string Bandwidth int Accept bool PortList string }
RouterStatusEntry represents a router status entry as its defined in https://gitweb.torproject.org/torspec.git/plain/dir-spec.txt
func ParseRouterStatusEntriesRaw ¶
func ParseRouterStatusEntriesRaw(data string) ([]RouterStatusEntry, error)