Documentation ¶
Overview ¶
crypto/x509 add sm2 support
Index ¶
- func MarshalSm2EcryptedPrivateKey(PrivKey *sm2.PrivateKey, pwd []byte) ([]byte, error)
- func MarshalSm2PrivateKey(key *sm2.PrivateKey, pwd []byte) ([]byte, error)
- func MarshalSm2PublicKey(key *sm2.PublicKey) ([]byte, error)
- func MarshalSm2UnecryptedPrivateKey(key *sm2.PrivateKey) ([]byte, error)
- func ParsePKCS8EcryptedPrivateKey(der, pwd []byte) (*sm2.PrivateKey, error)
- func ParsePKCS8PrivateKey(der, pwd []byte) (*sm2.PrivateKey, error)
- func ParsePKCS8UnecryptedPrivateKey(der []byte) (*sm2.PrivateKey, error)
- func ParseSm2PrivateKey(der []byte) (*sm2.PrivateKey, error)
- func ParseSm2PublicKey(der []byte) (*sm2.PublicKey, error)
- func ReadPrivateKeyFromMem(data []byte, pwd []byte) (*sm2.PrivateKey, error)
- func ReadPrivateKeyFromPem(FileName string, pwd []byte) (*sm2.PrivateKey, error)
- func ReadPublicKeyFromMem(data []byte, _ []byte) (*sm2.PublicKey, error)
- func ReadPublicKeyFromPem(FileName string, pwd []byte) (*sm2.PublicKey, error)
- func WritePrivateKeytoMem(key *sm2.PrivateKey, pwd []byte) ([]byte, error)
- func WritePrivateKeytoPem(FileName string, key *sm2.PrivateKey, pwd []byte) (bool, error)
- func WritePublicKeytoMem(key *sm2.PublicKey, _ []byte) ([]byte, error)
- func WritePublicKeytoPem(FileName string, key *sm2.PublicKey, _ []byte) (bool, error)
- type EncryptedPrivateKeyInfo
- type Pbes2Algorithms
- type Pbes2Encs
- type Pbes2KDfs
- type Pbes2Params
- type Pkdf2Params
- type PrivateKeyInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalSm2EcryptedPrivateKey ¶
func MarshalSm2EcryptedPrivateKey(PrivKey *sm2.PrivateKey, pwd []byte) ([]byte, error)
func MarshalSm2PrivateKey ¶
func MarshalSm2PrivateKey(key *sm2.PrivateKey, pwd []byte) ([]byte, error)
func MarshalSm2UnecryptedPrivateKey ¶
func MarshalSm2UnecryptedPrivateKey(key *sm2.PrivateKey) ([]byte, error)
func ParsePKCS8EcryptedPrivateKey ¶
func ParsePKCS8EcryptedPrivateKey(der, pwd []byte) (*sm2.PrivateKey, error)
func ParsePKCS8PrivateKey ¶
func ParsePKCS8PrivateKey(der, pwd []byte) (*sm2.PrivateKey, error)
func ParsePKCS8UnecryptedPrivateKey ¶
func ParsePKCS8UnecryptedPrivateKey(der []byte) (*sm2.PrivateKey, error)
func ParseSm2PrivateKey ¶
func ParseSm2PrivateKey(der []byte) (*sm2.PrivateKey, error)
func ReadPrivateKeyFromMem ¶
func ReadPrivateKeyFromMem(data []byte, pwd []byte) (*sm2.PrivateKey, error)
func ReadPrivateKeyFromPem ¶
func ReadPrivateKeyFromPem(FileName string, pwd []byte) (*sm2.PrivateKey, error)
func ReadPublicKeyFromMem ¶
func ReadPublicKeyFromPem ¶
func WritePrivateKeytoMem ¶
func WritePrivateKeytoMem(key *sm2.PrivateKey, pwd []byte) ([]byte, error)
func WritePrivateKeytoPem ¶
Types ¶
type EncryptedPrivateKeyInfo ¶
type EncryptedPrivateKeyInfo struct { EncryptionAlgorithm Pbes2Algorithms EncryptedData []byte }
reference to https://www.rfc-editor.org/rfc/rfc5958.txt
type Pbes2Algorithms ¶
type Pbes2Algorithms struct { IdPBES2 asn1.ObjectIdentifier Pbes2Params Pbes2Params }
reference to https://www.ietf.org/rfc/rfc2898.txt
type Pbes2Encs ¶
type Pbes2Encs struct { EncryAlgo asn1.ObjectIdentifier IV []byte }
type Pbes2KDfs ¶
type Pbes2KDfs struct { IdPBKDF2 asn1.ObjectIdentifier Pkdf2Params Pkdf2Params }
reference to https://www.ietf.org/rfc/rfc2898.txt
type Pbes2Params ¶
type Pbes2Params struct { KeyDerivationFunc Pbes2KDfs // PBES2-KDFs EncryptionScheme Pbes2Encs // PBES2-Encs }
reference to https://www.ietf.org/rfc/rfc2898.txt
type Pkdf2Params ¶
type Pkdf2Params struct { Salt []byte IterationCount int Prf pkix.AlgorithmIdentifier }
reference to https://www.ietf.org/rfc/rfc2898.txt
type PrivateKeyInfo ¶
type PrivateKeyInfo struct { Version int // v1 or v2 PrivateKeyAlgorithm []asn1.ObjectIdentifier PrivateKey []byte }
reference to https://www.rfc-editor.org/rfc/rfc5958.txt
Click to show internal directories.
Click to hide internal directories.