Documentation ¶
Index ¶
- func PEMtoPrivateKey(raw []byte, pwd []byte) (*sm2.PrivateKey, error)
- func PEMtoPublicKey(raw []byte, pwd []byte) (*sm2.PublicKey, error)
- func PrivateKeyToEncryptedPEM(priKey *sm2.PrivateKey, pwd []byte) ([]byte, error)
- func PrivateKeyToPEM(privateKey *sm2.PrivateKey, pwd []byte) ([]byte, error)
- func PublicKeyToEncryptedPEM(publicKey *sm2.PublicKey, pwd []byte) ([]byte, error)
- func PublicKeyToPEM(publicKey *sm2.PublicKey, pwd []byte) ([]byte, error)
- type AlgorithmIdentifier
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PEMtoPrivateKey ¶
func PEMtoPrivateKey(raw []byte, pwd []byte) (*sm2.PrivateKey, error)
PEMtoPrivateKey unmarshal a pem to private key
func PEMtoPublicKey ¶
PEMtoPublicKey unmarshal a pem to public key
func PrivateKeyToEncryptedPEM ¶ added in v1.0.0
func PrivateKeyToEncryptedPEM(priKey *sm2.PrivateKey, pwd []byte) ([]byte, error)
PrivateKeyToEncryptedPEM converts a private key to an encrypted PEM
func PrivateKeyToPEM ¶
func PrivateKeyToPEM(privateKey *sm2.PrivateKey, pwd []byte) ([]byte, error)
PrivateKeyToPEM converts the private key to PEM format. EC private keys are converted to PKCS#8 format. RSA private keys are converted to PKCS#1 format.
func PublicKeyToEncryptedPEM ¶
PublicKeyToEncryptedPEM converts a public key to encrypted pem
Types ¶
type AlgorithmIdentifier ¶ added in v1.0.0
type AlgorithmIdentifier struct { Algorithm asn1.ObjectIdentifier Parameters asn1.RawValue `asn1:"optional"` }
Click to show internal directories.
Click to hide internal directories.