Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( ErrDecodeAttestedCredentialData = Error{/* contains filtered or unexported fields */} ErrDecodeAuthenticatorData = Error{/* contains filtered or unexported fields */} ErrDecodeCOSEKey = Error{/* contains filtered or unexported fields */} ErrECDAANotSupported = Error{/* contains filtered or unexported fields */} ErrEncodeAttestedCredentialData = Error{/* contains filtered or unexported fields */} ErrEncodeAuthenticatorData = Error{/* contains filtered or unexported fields */} ErrGenerateChallenge = Error{/* contains filtered or unexported fields */} ErrMarshalAttestationObject = Error{/* contains filtered or unexported fields */} ErrOption = Error{/* contains filtered or unexported fields */} ErrNotImplemented = Error{/* contains filtered or unexported fields */} ErrUnmarshalAttestationObject = Error{/* contains filtered or unexported fields */} ErrVerifyAttestation = Error{/* contains filtered or unexported fields */} ErrVerifyAuthentication = Error{/* contains filtered or unexported fields */} ErrVerifyClientExtensionOutput = Error{/* contains filtered or unexported fields */} ErrVerifyRegistration = Error{/* contains filtered or unexported fields */} ErrVerifySignature = Error{/* contains filtered or unexported fields */} )
Categorical top-level errors
Functions ¶
func DecodePublicKey ¶
DecodePublicKey parses a crypto.PublicKey from a COSEKey
func New ¶
func New(key interface{}) *jwxImpl
It creates a new JWE object, using the given key, and sets the default key and content encryption algorithms to ECDH-ES and AES-CBC-HMAC-SHA256, respectively
func VerifySignature ¶
VerifySignature verifies a signature using a provided COSEKey, message, and signature
Types ¶
type COSEAlgorithmIdentifier ¶
type COSEAlgorithmIdentifier int
COSEAlgorithmIdentifier is a number identifying a cryptographic algorithm
const ( AlgorithmRS1 COSEAlgorithmIdentifier = -65535 AlgorithmRS512 COSEAlgorithmIdentifier = -259 AlgorithmRS384 COSEAlgorithmIdentifier = -258 AlgorithmRS256 COSEAlgorithmIdentifier = -257 AlgorithmPS512 COSEAlgorithmIdentifier = -39 AlgorithmPS384 COSEAlgorithmIdentifier = -38 AlgorithmPS256 COSEAlgorithmIdentifier = -37 AlgorithmES512 COSEAlgorithmIdentifier = -36 AlgorithmES384 COSEAlgorithmIdentifier = -35 AlgorithmEdDSA COSEAlgorithmIdentifier = -8 AlgorithmES256 COSEAlgorithmIdentifier = -7 )
enum values for COSEAlgorithmIdentifier type
type COSEEllipticCurve ¶
type COSEEllipticCurve int
COSEEllipticCurve is a number identifying an elliptic curve
const ( CurveP256 COSEEllipticCurve = 1 CurveP384 COSEEllipticCurve = 2 CurveP521 COSEEllipticCurve = 3 )
enum values for COSEEllipticCurve type
type COSEKey ¶
type COSEKey struct { Kty int `cbor:"1,keyasint,omitempty"` Kid []byte `cbor:"2,keyasint,omitempty"` Alg int `cbor:"3,keyasint,omitempty"` KeyOpts int `cbor:"4,keyasint,omitempty"` IV []byte `cbor:"5,keyasint,omitempty"` CrvOrNOrK cbor.RawMessage `cbor:"-1,keyasint,omitempty"` // K for symmetric keys, Crv for elliptic curve keys, N for RSA modulus XOrE cbor.RawMessage `cbor:"-2,keyasint,omitempty"` // X for curve x-coordinate, E for RSA public exponent Y cbor.RawMessage `cbor:"-3,keyasint,omitempty"` // Y for curve y-cooridate D []byte `cbor:"-4,keyasint,omitempty"` }
COSEKey represents a key decoded from COSE format.
type COSEKeyType ¶
type COSEKeyType int
COSEKeyType is a number identifying a key type
const ( KeyTypeOKP COSEKeyType = 1 KeyTypeEC2 COSEKeyType = 2 KeyTypeRSA COSEKeyType = 3 )
enum values for COSEKeyType type