Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrUnsupportedKeyType = errors.New("the type of key provided is not supported by the algorithm")
View Source
var ErrVerificationFailed = errors.New("the signature could not be verified using the internally held key")
Functions ¶
func Algorithms ¶
func Algorithms() map[int]COSEAlgorithm
Algorithms returns the implemented COSE algorithms by COSE algorithm value.
Types ¶
type COSEAlgorithm ¶
type COSEAlgorithm interface { // Value returns the COSE algorithm value for the algorithm. Value() int // CheckKeyType checks that the public key is the correct type for the // algorithm, returning an error if not. CheckKeyType(key any) error // Verify uses the public key to perform a verification of the message data // using sig, returning an error if the key type is incorrect or the // verification failed. Verify(key any, message, sig []byte) error }
COSEAlgorithm implementers provide functions for using public keys to verify data signed using standard COSE algorithms.
See the algorithm definitions: https://www.iana.org/assignments/cose/cose.xhtml#algorithms
type ES256 ¶
type ES256 struct{}
ES256 uses ECDSA keys to verify ASN.1 signatures of SHA256 hashes.
func (*ES256) CheckKeyType ¶
type EdDSA ¶
type EdDSA struct{}
EdDSA uses Ed25519 keys to verify signatures.
func (*EdDSA) CheckKeyType ¶
type RS256 ¶
type RS256 struct{}
RS256 uses RSA keys to verify PKCS#1 v1.5 signatures generated using SHA256.
func (*RS256) CheckKeyType ¶
Click to show internal directories.
Click to hide internal directories.