package
1.3.2
Repository: https://github.com/ldclabs/cose.git
Documentation: pkg.go.dev

# Packages

(c) 2022-present, LDC Labs, Inc.
Package aesgcm implements content encryption algorithm AES-GCM for COSE as defined in RFC9053.
Package aesmac implements message authentication code algorithm AES-CBC-MAC for COSE as defined in RFC9053.
Package chacha20poly1305 implements content encryption algorithm ChaCha20/Poly1305 for COSE as defined in RFC9053.
Package ecdh implements key agreement algorithm ECDH for COSE as defined in RFC9053.
Package ecdsa implements signature algorithm ECDSA for COSE as defined in RFC9053.
Package ed25519 implements signature algorithm Ed25519 for COSE as defined in RFC9053.
Package hkdf implements key derivation function HKDF for COSE as defined in RFC9053.
Package hmac implements message authentication code algorithm HMAC for COSE as defined in RFC9053.

# Functions

Base64Bytesify converts a base64url string to []byte.
ComputeHash computes a hash of the given data using the given hash.
CrvAlg returns the algorithm that matched the key's curve.
GetRandomBytes randomly generates n bytes.
GetRandomUint32 randomly generates an unsigned 32-bit integer.
HexBytesify converts a hex string to []byte.
MarshalCBOR marshals value with the special cbor.EncOptions.
MustMarshalCBOR marshals value with the special cbor.EncOptions.
RegisterEncryptor registers a EncryptorFactory for the given key type and algorithm.
RegisterMACer registers a MACerFactory for the given key type and algorithm.
RegisterSigner registers a SignerFactory for the given key type, algorithm, and curve.
RegisterVerifier registers a VerifierFactory for the given key type, algorithm, and curve.
SumKid returns a 20 bytes kid with given data.
ToInt converts the given value to int, the range is [math.MinInt32, math.MaxInt32].
UnmarshalCBOR unmarshals data into value with the special cbor.DecOptions.
UnwrapBytes returns the data if err is nil, otherwise it panics.
ValidCBOR returns true if data is valid CBOR.

# Interfaces

Encryptor is the encrypting and decrypting interface for content encryption.
MACer is the MAC interface for MAC objects.
Signer is the signing interface for signing objects.
Verifier is the verifying interface for signing objects.

# Type aliases

Alg represents an IANA algorithm entry in the COSE Algorithms registry.
ByteStr represents a byte string.
CoseMap represents a map of int/text to any value.
EncryptorFactory is a function that returns a Encryptor for the given key.
IntMap is an alias of CoseMap.
Key represents a COSE_Key object.
KeySet is a set of Keys.
MACerFactory is a function that returns a MACer for the given key.
Ops represents the key operations.
SignerFactory is a function that returns a Signer for the given key.
Signers is a list of signers to be used for signing with one or more signers.
VerifierFactory is a function that returns a Verifier for the given key.
Verifiers is a list of verifiers to be used for verifying with one or more verifiers.