mirror of
https://github.com/emmansun/gmsm.git
synced 2025-05-19 15:36:18 +08:00
PKCS7添加获取EnvelopedData和EncryptedData的方法
This commit is contained in:
parent
3968b9d8b5
commit
dca2b5a187
@ -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"`
|
||||
|
Loading…
x
Reference in New Issue
Block a user