Versions in this module Expand all Collapse all v0 v0.9.1 Oct 1, 2015 Changes in this version + var ErrECDSAVerification = errors.New("crypto/ecdsa: verification error") + var ErrInvalidKey = errors.New("key is invalid") + var ErrKeyMustBePEMEncoded = errors.New("Invalid Key: Key must be PEM encoded PKCS1 or PKCS8 private key") + var ErrNotECPrivateKey = errors.New("Key is not a valid ECDSA private key") + var ErrNotECPublicKey = errors.New("Key is not a valid ECDSA public key") + var ErrNotRSAPrivateKey = errors.New("Key is not a valid RSA private key") + var ErrSignatureInvalid = errors.New("signature is invalid") + var SigningMethodES256 = &SigningMethodECDSA + var SigningMethodES384 = &SigningMethodECDSA + var SigningMethodES512 = &SigningMethodECDSA + var SigningMethodHS256 = &SigningMethodHMAC + var SigningMethodHS384 = &SigningMethodHMAC + var SigningMethodHS512 = &SigningMethodHMAC + var SigningMethodPS256 = &SigningMethodRSAPSS + var SigningMethodPS384 = &SigningMethodRSAPSS + var SigningMethodPS512 = &SigningMethodRSAPSS + var SigningMethodRS256 = &SigningMethodRSA + var SigningMethodRS384 = &SigningMethodRSA + var SigningMethodRS512 = &SigningMethodRSA + var Unsecured = &SigningMethodNone + func ParseECPrivateKeyFromPEM(key []byte) (*ecdsa.PrivateKey, error) + func ParseECPublicKeyFromPEM(key []byte) (*ecdsa.PublicKey, error) + func ParseRSAPrivateKeyFromPEM(key []byte) (*rsa.PrivateKey, error) + func ParseRSAPublicKeyFromPEM(key []byte) (*rsa.PublicKey, error) + type ECPoint struct + R *big.Int + S *big.Int + type Signature []byte + func (s *Signature) UnmarshalJSON(b []byte) error + func (s Signature) Base64() ([]byte, error) + func (s Signature) MarshalJSON() ([]byte, error) + type SigningMethod interface + Alg func() string + Hasher func() crypto.Hash + Sign func(raw []byte, key interface{}) (Signature, error) + Verify func(raw []byte, sig Signature, key interface{}) error + type SigningMethodECDSA struct + Hash crypto.Hash + Name string + func (m *SigningMethodECDSA) Alg() string + func (m *SigningMethodECDSA) Hasher() crypto.Hash + func (m *SigningMethodECDSA) MarshalJSON() ([]byte, error) + func (m *SigningMethodECDSA) Sign(data []byte, key interface{}) (Signature, error) + func (m *SigningMethodECDSA) Verify(raw []byte, signature Signature, key interface{}) error + type SigningMethodHMAC struct + Hash crypto.Hash + Name string + func (m *SigningMethodHMAC) Alg() string + func (m *SigningMethodHMAC) Hasher() crypto.Hash + func (m *SigningMethodHMAC) MarshalJSON() ([]byte, error) + func (m *SigningMethodHMAC) Sign(data []byte, key interface{}) (Signature, error) + func (m *SigningMethodHMAC) Verify(raw []byte, signature Signature, key interface{}) error + type SigningMethodNone struct + Hash crypto.Hash + Name string + func (m *SigningMethodNone) Alg() string + func (m *SigningMethodNone) Hasher() crypto.Hash + func (m *SigningMethodNone) MarshalJSON() ([]byte, error) + func (m *SigningMethodNone) Sign(_ []byte, _ interface{}) (Signature, error) + func (m *SigningMethodNone) Verify(_ []byte, _ Signature, _ interface{}) error + type SigningMethodRSA struct + Hash crypto.Hash + Name string + func (m *SigningMethodRSA) Alg() string + func (m *SigningMethodRSA) Hasher() crypto.Hash + func (m *SigningMethodRSA) MarshalJSON() ([]byte, error) + func (m *SigningMethodRSA) Sign(data []byte, key interface{}) (Signature, error) + func (m *SigningMethodRSA) Verify(raw []byte, sig Signature, key interface{}) error + type SigningMethodRSAPSS struct + Options *rsa.PSSOptions + func (m *SigningMethodRSAPSS) Hasher() crypto.Hash + func (m *SigningMethodRSAPSS) MarshalJSON() ([]byte, error) + func (m *SigningMethodRSAPSS) Sign(raw []byte, key interface{}) (Signature, error) + func (m *SigningMethodRSAPSS) Verify(raw []byte, signature Signature, key interface{}) error