Documentation ¶
Index ¶
- func CheckKey(k key.Key) error
- func DecodeSignature(curve elliptic.Curve, sig []byte) (r, s *big.Int, err error)
- func EncodeSignature(curve elliptic.Curve, r, s *big.Int) ([]byte, error)
- func GenerateKey(alg key.Alg) (key.Key, error)
- func KeyFromPrivate(pk ecdsa.PrivateKey) (key.Key, error)
- func KeyFromPublic(pk ecdsa.PublicKey) (key.Key, error)
- func NewSigner(k key.Key) (key.Signer, error)
- func NewVerifier(k key.Key) (key.Verifier, error)
- func ToPublicKey(k key.Key) (key.Key, error)
- func TryCompresse(k key.Key)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckKey ¶
CheckKey checks whether the given key is a valid ECDSA key.
Reference https://datatracker.ietf.org/doc/html/rfc9053#section-2-1
func DecodeSignature ¶
DecodeSignature decodes (r, s) from a signature binary string using the method specified by RFC 8152 section 8.1.
Reference: https://datatracker.ietf.org/doc/html/rfc9052#section-8.1
func EncodeSignature ¶
EncodeSignature encodes (r, s) into a signature binary string using the method specified by RFC 8152 section 8.1.
Reference: https://datatracker.ietf.org/doc/html/rfc9052#section-8.1
func GenerateKey ¶
GenerateKey generates a new key.Key with given algorithm for ECDSA.
func KeyFromPrivate ¶
func KeyFromPrivate(pk ecdsa.PrivateKey) (key.Key, error)
KeyFromPrivate returns a private Key with given ecdsa.PrivateKey.
func KeyFromPublic ¶
KeyFromPublic returns a public Key with given ecdsa.PublicKey.
func NewVerifier ¶
NewVerifier creates a key.Verifier for the given public key.
func ToPublicKey ¶
ToPublicKey converts the given private key to a public key. If the key is already a public key, it is returned as-is.
func TryCompresse ¶
Types ¶
This section is empty.