Documentation ¶
Index ¶
- Variables
- func Decode(pfxData []byte, password string) (privateKey any, certificate *x509.Certificate, err error)
- func DecodeChain(pfxData []byte, password string) (privateKey any, certificate *x509.Certificate, caCerts []*x509.Certificate, ...)
- func DecodeSecret(pfxData []byte, password string) (secretKey []byte, err error)
- func DecodeTrustStore(pfxData []byte, password string) (certs []*x509.Certificate, err error)
- func DecodeTrustStoreEntries(pfxData []byte, password string) (trustStoreKeys []cryptobin_pkcs12.TrustStoreKey, err error)
- func LoadPKCS12FromBytes(pfxData []byte, password string) (*cryptobin_pkcs12.PKCS12, error)
- func LoadPKCS12FromReader(reader io.Reader, password string) (*cryptobin_pkcs12.PKCS12, error)
- func Parse(ber []byte, password []byte) ([]byte, error)
- type AlgorithmIdentifier
- type ContentInfo
- type DigestInfo
- type EncryptedContentInfo
- type EncryptedData
- type MacData
- type PfxPdu
Constants ¶
This section is empty.
Variables ¶
View Source
var LoadPKCS12 = LoadPKCS12FromBytes
Functions ¶
func Decode ¶
func Decode(pfxData []byte, password string) ( privateKey any, certificate *x509.Certificate, err error, )
解析 ber 编码的 PKCS12 证书
func DecodeChain ¶
func DecodeChain(pfxData []byte, password string) ( privateKey any, certificate *x509.Certificate, caCerts []*x509.Certificate, err error, )
解析 ber 编码的 PKCS12 证书
func DecodeSecret ¶
解析 ber 编码的 PKCS12 证书
func DecodeTrustStore ¶
func DecodeTrustStore(pfxData []byte, password string) (certs []*x509.Certificate, err error)
解析 ber 编码的 PKCS12 证书
func DecodeTrustStoreEntries ¶
func DecodeTrustStoreEntries(pfxData []byte, password string) (trustStoreKeys []cryptobin_pkcs12.TrustStoreKey, err error)
解析 ber 编码的 PKCS12 证书
func LoadPKCS12FromBytes ¶ added in v1.0.2033
func LoadPKCS12FromBytes(pfxData []byte, password string) (*cryptobin_pkcs12.PKCS12, error)
LoadPKCS12FromBytes loads the key store from the bytes data.
func LoadPKCS12FromReader ¶ added in v1.0.2033
LoadPKCS12FromReader loads the key store from the specified file.
Types ¶
type AlgorithmIdentifier ¶
type AlgorithmIdentifier struct { Algorithm cryptobin_asn1.ObjectIdentifier Parameters cryptobin_asn1.RawValue `asn1:"optional"` }
type ContentInfo ¶
type ContentInfo struct { ContentType cryptobin_asn1.ObjectIdentifier Content cryptobin_asn1.RawValue `asn1:"tag:0,explicit,optional"` }
type DigestInfo ¶
type DigestInfo struct { Algorithm AlgorithmIdentifier Digest []byte }
from PKCS#7:
type EncryptedContentInfo ¶
type EncryptedContentInfo struct { ContentType cryptobin_asn1.ObjectIdentifier ContentEncryptionAlgorithm AlgorithmIdentifier EncryptedContent cryptobin_asn1.RawValue `asn1:"tag:0,optional"` }
type EncryptedData ¶
type EncryptedData struct { Version int EncryptedContentInfo EncryptedContentInfo }
type MacData ¶
type MacData struct { Mac DigestInfo MacSalt []byte Iterations int `asn1:"optional,default:1"` }
type PfxPdu ¶
type PfxPdu struct { Version int AuthSafe ContentInfo MacData MacData `asn1:"optional"` }
Click to show internal directories.
Click to hide internal directories.