Versions in this module Expand all Collapse all v0 v0.0.1 Jan 17, 2022 Changes in this version + const EncryptionAlgorithmAES128GCM + const EncryptionAlgorithmDESCBC + const NumericString + var ContentEncryptionAlgorithm = EncryptionAlgorithmDESCBC + var ErrNotEncryptedContent = xerrors.New("pkcs7: content data is a decryptable data type") + var ErrUnsupportedAlgorithm = xerrors.New(...) + var ErrUnsupportedContentType = xerrors.New("pkcs7: cannot parse data: unimplemented content type") + var ErrUnsupportedEncryptionAlgorithm = xerrors.New("pkcs7: cannot encrypt content: only DES-CBC and AES-128-GCM supported") + func DegenerateCertificate(cert []byte) ([]byte, error) + func Encrypt(content []byte, recipients []*x509.Certificate) ([]byte, error) + func ParseCertificate(der []byte) (*x509.Certificate, error) + func ParseCertificates(der []byte) ([]*x509.Certificate, error) + type Attribute struct + Type asn1.ObjectIdentifier + Value interface{} + type MessageDigestMismatchError struct + ActualDigest []byte + ExpectedDigest []byte + func (err *MessageDigestMismatchError) Error() string + type PKCS7 struct + CRLs []pkix.CertificateList + Certificates []*x509.Certificate + Content []byte + Signers []signerInfo + func NewDecoder(r io.Reader) *PKCS7 + func Parse(data []byte) (p7 *PKCS7, err error) + func (p7 *PKCS7) Decrypt(cert *x509.Certificate, pk crypto.PrivateKey) ([]byte, error) + func (p7 *PKCS7) GetOnlySigner() *x509.Certificate + func (p7 *PKCS7) UnmarshalSignedAttribute(attributeType asn1.ObjectIdentifier, out interface{}) error + func (p7 *PKCS7) Verify() (err error) + func (p7 *PKCS7) VerifyTo(dest io.Writer) error + type SignedData struct + func NewEncoder(w io.Writer) *SignedData + func NewSignedData(data []byte) (*SignedData, error) + func (sd *SignedData) AddCertificate(cert *x509.Certificate) + func (sd *SignedData) AddSigner(cert *x509.Certificate, pkey crypto.PrivateKey, config SignerInfoConfig) error + func (sd *SignedData) Detach() + func (sd *SignedData) Finish() ([]byte, error) + func (sd *SignedData) SignFrom(r io.Reader, size int) (err error) + type SignerInfoConfig struct + ExtraSignedAttributes []Attribute