PKCS7中增加RecipientInfos

This commit is contained in:
zhangyongding 2024-09-29 09:54:05 +08:00
parent dca2b5a187
commit d9fc9bd5c6

View File

@ -26,6 +26,7 @@ type PKCS7 struct {
Certificates []*smx509.Certificate
CRLs []pkix.CertificateList
Signers []signerInfo
RecipientInfos []recipientInfo
raw any
}
@ -33,22 +34,6 @@ func (p7 *PKCS7) Raw() any {
return p7.raw
}
func (p7 *PKCS7) EnvelopedData() *envelopedData {
ed, ok := p7.raw.(envelopedData)
if ok {
return &ed
}
return nil
}
func (p7 *PKCS7) EncryptedData() *encryptedData {
ed, ok := p7.raw.(encryptedData)
if ok {
return &ed
}
return nil
}
type contentInfo struct {
ContentType asn1.ObjectIdentifier
Content asn1.RawValue `asn1:"explicit,optional,tag:0"`
@ -255,6 +240,7 @@ func parseEnvelopedData(data []byte) (*PKCS7, error) {
}
return &PKCS7{
raw: ed,
RecipientInfos: ed.RecipientInfos,
}, nil
}