Versions in this module Expand all Collapse all v2 v2.0.1 Oct 3, 2023 Changes in this version + const EncryptionAlgorithmAES128GCM + const EncryptionAlgorithmDESCBC + var ContentEncryptionAlgorithm = EncryptionAlgorithmDESCBC + var ErrNotEncryptedContent = errors.New("pkcs7: content data is a decryptable data type") + var ErrUnsupportedAlgorithm = errors.New(...) + var ErrUnsupportedContentType = errors.New("pkcs7: cannot parse data: unimplemented content type") + var ErrUnsupportedEncryptionAlgorithm = errors.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) + 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 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(expectedHash []byte) (err error) + type SignedData struct + 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) + type SignerInfoConfig struct + ExtraSignedAttributes []Attribute