Documentation ¶
Index ¶
- Constants
- func DERToPrivateKey(der []byte) (key interface{}, err error)
- func DERToPublicKey(raw []byte) (pub interface{}, err error)
- func MarshalECPrivateKey(privateKey *ecdsa.PrivateKey) ([]byte, error)
- func MarshalPKIXPublicKey(pub interface{}) ([]byte, error)
- func PEMtoPrivateKey(raw []byte, pwd []byte) (interface{}, error)
- func ParseCertificate(asn1Data []byte) (*x509.Certificate, error)
- func ParseECPrivateKey(der []byte) (key interface{}, err error)
- func ParsePKCS8PrivateKey(der []byte) (key *ecdsa.PrivateKey, err error)
- func ParsePKIXPublicKey(derBytes []byte) (pub interface{}, err error)
- func PemToPublicKey(raw []byte, pwd []byte) (interface{}, error)
- func PrivateKeyToPEM(privateKey interface{}, pwd []byte) ([]byte, error)
- func PublicKeyToPEM(publicKey interface{}, pwd []byte) ([]byte, error)
Constants ¶
View Source
const ( UnknownPublicKeyAlgorithm x509.PublicKeyAlgorithm = iota RSA DSA ECDSA )
View Source
const ( UnknownSignatureAlgorithm x509.SignatureAlgorithm = iota SM2WithSM3 )
Variables ¶
This section is empty.
Functions ¶
func DERToPrivateKey ¶
func DERToPublicKey ¶
DerToPublicKey unmarshals a der to public key
func MarshalECPrivateKey ¶
func MarshalECPrivateKey(privateKey *ecdsa.PrivateKey) ([]byte, error)
func MarshalPKIXPublicKey ¶
func PEMtoPrivateKey ¶
PEMtoPrivateKey unmarshals a pem to private key
func ParseCertificate ¶
func ParseCertificate(asn1Data []byte) (*x509.Certificate, error)
func ParseECPrivateKey ¶
func ParsePKCS8PrivateKey ¶
func ParsePKCS8PrivateKey(der []byte) (key *ecdsa.PrivateKey, err error)
func ParsePKIXPublicKey ¶
func PemToPublicKey ¶
pemToPublicKey unmarshals a pem to public key
func PrivateKeyToPEM ¶
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 PublicKeyToPEM ¶
publicKeyToPEM marshals a public key to the pem format
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.