Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSigningKey ¶
func GetSigningKey(key string, alg jwa.SignatureAlgorithm) (interface{}, error)
GetSigningKey returns a *rsa.PublicKey or *ecdsa.PublicKey typically encoded in PEM blocks of type "PUBLIC KEY", for RSA and ECDSA family of algorithms. For HMAC family, it return a []byte value
Types ¶
type ECDSAVerifier ¶
type ECDSAVerifier struct {
// contains filtered or unexported fields
}
ECDSAVerifier implements the Verifier interface
type HMACVerifier ¶
type HMACVerifier struct {
// contains filtered or unexported fields
}
HMACVerifier implements the Verifier interface
func (HMACVerifier) Verify ¶
func (v HMACVerifier) Verify(signingInput, signature []byte, key interface{}) (err error)
Verify checks whether the signature for a given input and key is correct
type RSAVerifier ¶
type RSAVerifier struct {
// contains filtered or unexported fields
}
RSAVerifier implements the Verifier interface
func (RSAVerifier) Verify ¶
func (v RSAVerifier) Verify(payload, signature []byte, key interface{}) error
Verify checks if a JWS is valid.
type Verifier ¶
type Verifier interface { // Verify checks whether the payload and signature are valid for // the given key. // `key` is the key used for verifying the payload, and is usually // the public key associated with the signature method. For example, // for `jwa.RSXXX` and `jwa.PSXXX` types, you need to pass the // `*"crypto/rsa".PublicKey` type. // Check the documentation for each verifier for details Verify(payload []byte, signature []byte, key interface{}) error }
Verifier provides a common interface for supported alg verification methods
Click to show internal directories.
Click to hide internal directories.