Documentation ¶
Index ¶
- func Decrypt(priv *ecdsa.PrivateKey, ciphertext []byte) ([]byte, error)
- func Encrypt(random io.Reader, pub *ecdsa.PublicKey, msg []byte) ([]byte, error)
- func MarshalPKIXPublicKey(pub interface{}) ([]byte, error)
- func P256() elliptic.Curve
- func ParsePKIXPublicKey(derBytes []byte) (interface{}, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Decrypt ¶
func Decrypt(priv *ecdsa.PrivateKey, ciphertext []byte) ([]byte, error)
Decrypt sm2 decrypt implementation
func MarshalPKIXPublicKey ¶
MarshalPKIXPublicKey converts a public key to PKIX, ASN.1 DER form.
The following key types are currently supported: *rsa.PublicKey, *ecdsa.PublicKey and ed25519.PublicKey. Unsupported key types result in an error.
This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY".
func ParsePKIXPublicKey ¶
ParsePKIXPublicKey parses a public key in PKIX, ASN.1 DER form.
It returns a *rsa.PublicKey, *dsa.PublicKey, *ecdsa.PublicKey, or ed25519.PublicKey. More types might be supported in the future.
This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.