Documentation ¶
Index ¶
- func Base64ToHex(identity string) (string, error)
- func CalculateDescriptorID(permanentID []byte, time int64, replica byte, deviation uint8, ...) ([]byte, error)
- func CalculateOnionAddress(permanentID []byte) string
- func CalculatePermanentID(permanentKey rsa.PublicKey) ([]byte, error)
- func DescriptorIDValidUntil(permanentID []byte, time int64) int64
- func GetSecretID(serviceID []byte, time int64, descriptorCookie string, replica byte) []byte
- func LoadKeysFromFile(filePath string) (*rsa.PublicKey, *rsa.PrivateKey, error)
- func NewLogger(debugMode bool, logFilePath string) (*zap.SugaredLogger, error)
- func NewNopLogger() *zap.SugaredLogger
- type ITimeProvider
- type MockTimeProvider
- type TimeProvider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Base64ToHex ¶
Base64ToHex decodes a base 64 string and returns its uppercase hex encoding
func CalculateDescriptorID ¶
func CalculateDescriptorID(permanentID []byte, time int64, replica byte, deviation uint8, descriptorCookie string) ([]byte, error)
CalculateDescriptorID computes the v2 descriptor ID
func CalculateOnionAddress ¶
CalculateOnionAddress returns the v2 onion address given the permanentID
func CalculatePermanentID ¶
CalculatePermanentID returns permanentID given the permanentKey(public key)
func DescriptorIDValidUntil ¶
DescriptorIDValidUntil calculates seconds until the descriptor ID changes
func GetSecretID ¶
GetSecretID returns the secretID which is used to calculate the descriptor ID SecretIDPart = H(time-period | descriptor-cookie | replica)
func LoadKeysFromFile ¶
LoadKeysFromFile returns an rsa public/private key pair given pem encoded private key
Types ¶
type ITimeProvider ¶
func NewTimeProvider ¶
func NewTimeProvider() ITimeProvider
type MockTimeProvider ¶
type MockTimeProvider struct {
// contains filtered or unexported fields
}
func (*MockTimeProvider) Now ¶
func (m *MockTimeProvider) Now() time.Time
func (*MockTimeProvider) Set ¶
func (m *MockTimeProvider) Set(theTime time.Time)
type TimeProvider ¶
type TimeProvider struct{}
func (*TimeProvider) Now ¶
func (t *TimeProvider) Now() time.Time
Click to show internal directories.
Click to hide internal directories.