formats

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 18, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrParamMissingFrom      = errors.New("parameter missing: from")
	ErrParamMissingFromKey   = errors.New("parameter missing: fromKey")
	ErrParamMissingInvoking  = errors.New("parameter missing: invoking")
	ErrParamMissingTo        = errors.New("parameter missing: to")
	ErrParamMissingToKey     = errors.New("parameter missing: toKey")
	ErrParamMissingTimestamp = errors.New("parameter missing: timestamp")
	ErrParamMissingNonce     = errors.New("parameter missing: nonce")
	ErrParamMissingStatus    = errors.New("parameter missing: status")

	ErrACSWrongNumParams = errors.New("wrong authenticated connection num params")
)
View Source
var (
	ErrEmptyInput               = errors.New("empty input")
	ErrVersionPrefixOutOfOrder  = errors.New("version prefix out of order")
	ErrVersionUnknown           = errors.New("unknown version string")
	ErrVersionMissing           = errors.New("missing version string or too many")
	ErrKeyAlgorithmWrongNumber  = errors.New("key algorithm missing or too many")
	ErrHashAlgorithmWrongNumber = errors.New("hash algorithm missing or too many")
	ErrPublicKeysMissing        = errors.New("public keys missing")
	ErrWrongKeySize             = errors.New("wrong key size")
	ErrZeroValueKey             = errors.New("zero-value key")
	ErrEmptyKey                 = errors.New("empty value for key")
	ErrUnsupportedAlgorithm     = errors.New("unsupported key algorithm")
	ErrBase64DecodeFailure      = errors.New("base64 decode failure")
	ErrPublicSuffixParseFailure = errors.New("public suffix parse failure")
	ErrNotTLDPlusOneDomain      = errors.New("not a TLD plus one domain")
)

Functions

func B64truncate

func B64truncate(rawMAC []byte, length int) string

func EncodeKeyBase64

func EncodeKeyBase64(keyBytes []byte) string

func EncodeSignatureSuffix

func EncodeSignatureSuffix(
	signatureForBody []byte, signatureForURL []byte) string

func ExtractKeyAliasFromPublicKeyBase64

func ExtractKeyAliasFromPublicKeyBase64(publicKeyBase64 string) string

func ParseBase64EncodedKey

func ParseBase64EncodedKey(encodedKey string, length int) ([]byte, error)

func StatusToString added in v0.8.0

func StatusToString(status AuthenticatedConnectionProtocolStatus) string

Types

type AdsCertKeys

type AdsCertKeys struct {
	PublicKeys []ParsedPublicKey
}

func DecodeAdsCertKeysRecord

func DecodeAdsCertKeysRecord(keysRecord string) (*AdsCertKeys, error)

type AdsCertPolicy

type AdsCertPolicy struct {
	CanonicalCallsignDomain string
}

func DecodeAdsCertPolicyRecord

func DecodeAdsCertPolicyRecord(input string) (*AdsCertPolicy, error)

type AuthenticatedConnectionProtocolStatus added in v0.8.0

type AuthenticatedConnectionProtocolStatus int
const (
	StatusUnspecified AuthenticatedConnectionProtocolStatus = iota // this status is considered and handled as an error condition
	StatusOK
	StatusDeactivated
	StatusUnavailable
	StatusTesting
	StatusNotYetChecked
	StatusErrorOnSignature
	StatusErrorOnDNS
	StatusErrorOnDNSSEC
	StatusErrorOnAdsCertConfigParse
	StatusErrorOnAdsCertConfigEval
	StatusErrorOnKeyValidation
	StatusErrorOnSharedSecretCalculation
	StatusKeyFetchPending
	StatusReviewPending
	StatusDnsReturnedRCode
	StatusADPFParseError
	StatusADCRTDParseError
	StatusAdvisoryOnly
	StatusSuppressed
	StatusDelayed
)

func StringToStatus added in v0.8.0

type AuthenticatedConnectionSignature

type AuthenticatedConnectionSignature struct {
	// contains filtered or unexported fields
}

func DecodeAuthenticatedConnectionSignature

func DecodeAuthenticatedConnectionSignature(encodedMessage string) (*AuthenticatedConnectionSignature, error)

func NewAuthenticatedConnectionSignature

func NewAuthenticatedConnectionSignature(status AuthenticatedConnectionProtocolStatus, from string, invoking string) (*AuthenticatedConnectionSignature, error)

func (*AuthenticatedConnectionSignature) AddParametersForSignature

func (s *AuthenticatedConnectionSignature) AddParametersForSignature(
	fromKey string, to string, toKey string, timestamp string, nonce string) error

func (*AuthenticatedConnectionSignature) CompareSignatures

func (s *AuthenticatedConnectionSignature) CompareSignatures(signatureForBody []byte, signatureForURL []byte) (bool, bool)

func (*AuthenticatedConnectionSignature) EncodeMessage

func (s *AuthenticatedConnectionSignature) EncodeMessage() string

func (*AuthenticatedConnectionSignature) GetAttributeArray added in v0.8.0

func (s *AuthenticatedConnectionSignature) GetAttributeArray() []string

func (*AuthenticatedConnectionSignature) GetAttributeFrom

func (s *AuthenticatedConnectionSignature) GetAttributeFrom() string

func (*AuthenticatedConnectionSignature) GetAttributeInvoking

func (s *AuthenticatedConnectionSignature) GetAttributeInvoking() string

func (*AuthenticatedConnectionSignature) SetStatus added in v0.8.0

type ParsedPublicKey

type ParsedPublicKey struct {
	PublicKeyBytes []byte
	KeyAlias       string
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL