Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // Sadly this is missing from crypto/ecdsa compared to crypto/rsa ErrECDSAVerification = errors.New("crypto/ecdsa: verification error") ErrNotECPublicKey = errors.New("key is not a valid ECDSA public key") )
View Source
var ( SigningMethodES256 = SigningMethodECDSA{"ES256", crypto.SHA256, 32, 256} SigningMethodES384 = SigningMethodECDSA{"ES384", crypto.SHA384, 48, 384} SigningMethodES512 = SigningMethodECDSA{"ES512", crypto.SHA512, 66, 521} )
View Source
var ( SigningMethodRS256 = SigningMethodRSA{"RS256", crypto.SHA256} SigningMethodRS384 = SigningMethodRSA{"RS384", crypto.SHA384} SigningMethodRS512 = SigningMethodRSA{"RS512", crypto.SHA512} )
View Source
var (
ErrKeyMustBePEMEncoded = errors.New("key must be a PEM encoded PKCS1 key")
)
View Source
var (
ErrNotRSAPublicKey = errors.New("key is not a valid RSA public key")
)
Functions ¶
func ParsePublicKeyFromPEM ¶
Parse PEM encoded PKCS1 public key
Types ¶
type SigningMethod ¶
type SigningMethod interface { // Returns nil if signature is valid Verify(signingString, signature string, key crypto.PublicKey) error }
Implement SigningMethod to add new methods for signing or verifying tokens.
func GetSigningMethod ¶
func GetSigningMethod(header string) SigningMethod
GetSigningMethod returns a signing method from an encoded JWT header.
type SigningMethodECDSA ¶
Implements the ECDSA family of signing methods signing methods Expects *ecdsa.PrivateKey for signing and *ecdsa.PublicKey for verification
type SigningMethodRSA ¶
Implements the RSA family of signing methods signing methods Expects *rsa.PrivateKey for signing and *rsa.PublicKey for validation
Directories ¶
Path | Synopsis |
---|---|
internal
|
|
crypto/x509
Package x509 parses X.509-encoded keys and certificates.
|
Package x509 parses X.509-encoded keys and certificates. |
crypto/x509/pkix
Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP.
|
Package pkix contains shared, low level structures used for ASN.1 parsing and serialization of X.509 certificates, CRL and OCSP. |
encoding/asn1
Package asn1 implements parsing of DER-encoded ASN.1 data structures, as defined in ITU-T Rec X.690.
|
Package asn1 implements parsing of DER-encoded ASN.1 data structures, as defined in ITU-T Rec X.690. |
Click to show internal directories.
Click to hide internal directories.