Documentation
¶
Index ¶
- Variables
- func SignEC(unsigned string, key *ecdsa.PrivateKey) (string, error)
- func SignED25519(unsigned string, key ed25519.PrivateKey) string
- func SignHMAC(unsigned string, key []byte, hash crypto.Hash) (string, error)
- func SignRSA(unsigned string, key *rsa.PrivateKey, hash crypto.Hash) (string, error)deprecated
- func SignRSAPSS(unsigned string, key *rsa.PrivateKey, hash crypto.Hash) (string, error)
- func VerifyEC(unsigned string, signature string, key *ecdsa.PublicKey) error
- func VerifyED25519(unsigned string, signature string, key ed25519.PublicKey) error
- func VerifyHMAC(unsigned string, signature string, key []byte, hash crypto.Hash) error
- func VerifyRSA(unsigned string, signature string, key *rsa.PublicKey, hash crypto.Hash) errordeprecated
- func VerifyRSAPSS(unsigned string, signature string, key *rsa.PublicKey, hash crypto.Hash) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrInvalidSignature = errors.New("invalid signature") )
var ErrUnsupportedCurve = errors.New("unsupported curve")
Functions ¶
func SignEC ¶
func SignEC(unsigned string, key *ecdsa.PrivateKey) (string, error)
SignEC signs the payload using the Elliptic Curve algorithm.
func SignED25519 ¶
func SignED25519(unsigned string, key ed25519.PrivateKey) string
SignED25519 signs the payload using the EdDSA algorithm with Ed25519 curve.
func SignRSA
deprecated
SignRSA signs a string using RSA PKCS1 v1.5 and returns the signature.
Deprecated: RSASSA PKCS #1 v1.5 has been deprecated by the standards, and is only included for backwards compatibility. Use SignRSAPSS instead.
func SignRSAPSS ¶
SignRSAPSS signs the payload using the RSA-PSS algorithm.
func VerifyED25519 ¶
VerifyED25519 verifies the signature of the payload using the EdDSA algorithm with Ed25519 curve.
func VerifyHMAC ¶
VerifyHMAC verifies the signature of the unsigned string using the HMAC algorithm.
func VerifyRSA
deprecated
VerifyRSA verifies a signature against a string using RSA PKCS1 v1.5.
Deprecated: RSASSA PKCS #1 v1.5 has been deprecated by the standards, and is only included for backwards compatibility. Use VerifyRSAPSS instead.
Types ¶
This section is empty.