Documentation ¶
Index ¶
- func PEMtoPrivateKey(raw []byte, pwd []byte) (*sm2.PrivateKey, error)
- func PEMtoPublicKey(raw []byte, pwd []byte) (*sm2.PublicKey, error)
- func PrivateKeyToDER(privateKey *sm2.PrivateKey) ([]byte, 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)
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 PrivateKeyToDER ¶
func PrivateKeyToDER(privateKey *sm2.PrivateKey) ([]byte, error)
func PrivateKeyToEncryptedPEM ¶
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 ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.