Versions in this module Expand all Collapse all v1 v1.0.0 Jan 30, 2021 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 IssuerAndSerial struct + IssuerName asn1.RawValue + SerialNumber *big.Int + type MessageDigestMismatchError struct + ActualDigest []byte + ExpectedDigest []byte + func (err *MessageDigestMismatchError) Error() string + type PKCS7 struct + CRLs []pkix.CertificateList + Certificates []*x509.Certificate + Content []byte + ContentType asn1.ObjectIdentifier + 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) GetSignerInfos() []SignerInfo + func (p7 *PKCS7) UnmarshalSignedAttribute(attributeType asn1.ObjectIdentifier, out interface{}) error + func (p7 *PKCS7) Verify() (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 SignerAttribute struct + Type asn1.ObjectIdentifier + Value asn1.RawValue + type SignerInfo struct + AuthenticatedAttributes []SignerAttribute + DigestAlgorithm pkix.AlgorithmIdentifier + DigestEncryptionAlgorithm pkix.AlgorithmIdentifier + EncryptedDigest []byte + IssuerAndSerialNumber IssuerAndSerial + UnauthenticatedAttributes []SignerAttribute + Version int + func (si *SignerInfo) MarshalAuthenticatedAttributes() ([]byte, error) + func (si *SignerInfo) UnmarshalSignedAttribute(attributeType asn1.ObjectIdentifier, out interface{}) error + type SignerInfoConfig struct + ExtraSignedAttributes []Attribute