formats

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2021 License: Apache-2.0 Imports: 7 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)

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 AuthenticatedConnectionSignature

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

func DecodeAuthenticatedConnectionSignature

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

func NewAuthenticatedConnectionSignature

func NewAuthenticatedConnectionSignature(status string, 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) GetAttributeFrom

func (s *AuthenticatedConnectionSignature) GetAttributeFrom() string

func (*AuthenticatedConnectionSignature) GetAttributeInvoking

func (s *AuthenticatedConnectionSignature) GetAttributeInvoking() string

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