PKCS7添加获取EnvelopedData和EncryptedData的方法

This commit is contained in:
zhangyongding 2024-09-27 13:11:30 +08:00
parent 3968b9d8b5
commit dca2b5a187

View File

@ -29,6 +29,26 @@ type PKCS7 struct {
raw any
}
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"`