Versions in this module Expand all Collapse all v0 v0.0.1 Jan 18, 2024 Changes in this version + const EncryptionAlgorithmAES128CBC + const EncryptionAlgorithmAES128GCM + const EncryptionAlgorithmAES256CBC + const EncryptionAlgorithmAES256GCM + const EncryptionAlgorithmDESCBC + var ContentEncryptionAlgorithm = EncryptionAlgorithmDESCBC + var EC2IdentityDocumentFixture = ... + var ErrNotEncryptedContent = errors.New("pkcs7: content data is a decryptable data type") + var ErrPSKNotProvided = errors.New("pkcs7: cannot encrypt content: PSK not provided") + 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, AES-CBC, and AES-GCM supported") + var OIDAttributeContentType = asn1.ObjectIdentifier + var OIDAttributeMessageDigest = asn1.ObjectIdentifier + var OIDAttributeSigningTime = asn1.ObjectIdentifier + var OIDData = asn1.ObjectIdentifier + var OIDDigestAlgorithmDSA = asn1.ObjectIdentifier + var OIDDigestAlgorithmDSASHA1 = asn1.ObjectIdentifier + var OIDDigestAlgorithmECDSASHA1 = asn1.ObjectIdentifier + var OIDDigestAlgorithmECDSASHA256 = asn1.ObjectIdentifier + var OIDDigestAlgorithmECDSASHA384 = asn1.ObjectIdentifier + var OIDDigestAlgorithmECDSASHA512 = asn1.ObjectIdentifier + var OIDDigestAlgorithmSHA1 = asn1.ObjectIdentifier + var OIDDigestAlgorithmSHA256 = asn1.ObjectIdentifier + var OIDDigestAlgorithmSHA384 = asn1.ObjectIdentifier + var OIDDigestAlgorithmSHA512 = asn1.ObjectIdentifier + var OIDEncryptedData = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmAES128CBC = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmAES128GCM = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmAES256CBC = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmAES256GCM = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmDESCBC = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmDESEDE3CBC = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmECDSAP256 = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmECDSAP384 = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmECDSAP521 = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmRSA = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmRSASHA1 = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmRSASHA256 = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmRSASHA384 = asn1.ObjectIdentifier + var OIDEncryptionAlgorithmRSASHA512 = asn1.ObjectIdentifier + var OIDEnvelopedData = asn1.ObjectIdentifier + var OIDSignedData = asn1.ObjectIdentifier + func DegenerateCertificate(cert []byte) ([]byte, error) + func Encrypt(content []byte, recipients []*x509.Certificate) ([]byte, error) + func EncryptUsingPSK(content []byte, key []byte) ([]byte, error) + func TestDSASignWithOpenSSLAndVerify(t *testing.T) + func TestVerifyEC2(t *testing.T) + type Attribute struct + Type asn1.ObjectIdentifier + Value interface{} + type DSATestFixture struct + Certificate *x509.Certificate + Input []byte + func UnmarshalDSATestFixture(testPEMBlock string) DSATestFixture + 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, pkey crypto.PrivateKey) ([]byte, error) + func (p7 *PKCS7) DecryptUsingPSK(key []byte) ([]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) VerifyWithChain(truststore *x509.CertPool) (err error) + func (p7 *PKCS7) VerifyWithChainAtTime(truststore *x509.CertPool, currentTime time.Time) (err error) + type SignedData struct + func NewSignedData(data []byte) (*SignedData, error) + func (sd *SignedData) AddCertificate(cert *x509.Certificate) + func (sd *SignedData) AddSigner(ee *x509.Certificate, pkey crypto.PrivateKey, config SignerInfoConfig) error + func (sd *SignedData) AddSignerChain(ee *x509.Certificate, pkey crypto.PrivateKey, parents []*x509.Certificate, ...) error + func (sd *SignedData) Detach() + func (sd *SignedData) Finish() ([]byte, error) + func (sd *SignedData) GetSignedData() *signedData + func (sd *SignedData) RemoveAuthenticatedAttributes() + func (sd *SignedData) RemoveUnauthenticatedAttributes() + func (sd *SignedData) SetDigestAlgorithm(d asn1.ObjectIdentifier) + func (sd *SignedData) SetEncryptionAlgorithm(d asn1.ObjectIdentifier) + func (sd *SignedData) SignWithoutAttr(ee *x509.Certificate, pkey crypto.PrivateKey, config SignerInfoConfig) error + func (sd *SignedData) WithoutCertificates() + type SignerInfoConfig struct + ExtraSignedAttributes []Attribute + ExtraUnsignedAttributes []Attribute