Documentation ¶
Index ¶
- func AEStoEncryptedPEM(raw []byte, pwd []byte) ([]byte, error)
- func AEStoPEM(raw []byte) []byte
- func Clone(src []byte) []byte
- func DERToPrivateKey(der []byte) (key interface{}, err error)
- func DERToPublicKey(raw []byte) (pub interface{}, err error)
- func DERToSM2X509Certificate(asn1Data []byte) (*sm2.Certificate, error)
- func DERToX509Certificate(asn1Data []byte) (*x509.Certificate, error)
- func DirEmpty(path string) (bool, error)
- func DirExists(path string) (bool, error)
- func DirMissingOrEmpty(path string) (bool, error)
- func ErrToString(err error) string
- func PEMtoAES(raw []byte, pwd []byte) ([]byte, error)
- func PEMtoPrivateKey(raw []byte, pwd []byte) (interface{}, error)
- func PEMtoPublicKey(raw []byte, pwd []byte) (interface{}, error)
- func PrivateKeyToDER(privateKey interface{}) ([]byte, error)
- func PrivateKeyToEncryptedPEM(privateKey interface{}, pwd []byte) ([]byte, error)
- func PrivateKeyToPEM(privateKey interface{}, pwd []byte) (pemBytes []byte, err error)
- func PublicKeyToDER(publicKey interface{}) (der []byte, err error)
- func PublicKeyToEncryptedPEM(publicKey interface{}, pwd []byte) ([]byte, error)
- func PublicKeyToPEM(publicKey interface{}, pwd []byte) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AEStoEncryptedPEM ¶
AEStoEncryptedPEM encapsulates an AES key in the encrypted PEM format
func DERToPrivateKey ¶
DERToPrivateKey unmarshals a der to private key
func DERToPublicKey ¶
DERToPublicKey unmarshals a der to public key
func DERToSM2X509Certificate ¶
func DERToSM2X509Certificate(asn1Data []byte) (*sm2.Certificate, error)
func DERToX509Certificate ¶
func DERToX509Certificate(asn1Data []byte) (*x509.Certificate, error)
DERToX509Certificate converts der to x509
func DirMissingOrEmpty ¶
DirMissingOrEmpty checks is a directory is missin or empty
func ErrToString ¶
ErrToString converts and error to a string. If the error is nil, it returns the string "<clean>"
func PEMtoPrivateKey ¶
PEMtoPrivateKey unmarshals a pem to private key
func PEMtoPublicKey ¶
PEMtoPublicKey unmarshals a pem to public key
func PrivateKeyToDER ¶
PrivateKeyToDER marshals a private key to der
func PrivateKeyToEncryptedPEM ¶
PrivateKeyToEncryptedPEM converts a private key to an encrypted PEM
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 PublicKeyToDER ¶
PublicKeyToDER marshals a public key to the der format
func PublicKeyToEncryptedPEM ¶
PublicKeyToEncryptedPEM converts a public key to encrypted pem
func PublicKeyToPEM ¶
PublicKeyToPEM marshals a public key to the pem format
Types ¶
This section is empty.