Versions in this module Expand all Collapse all v0 v0.2.2 Apr 11, 2023 v0.2.1 Mar 30, 2023 Changes in this version + var ErrNoCertificate = errors.New("no certificate found") + var ErrTrailingData = ASN1Error + var ErrUnsupported = ASN1Error + var ErrWrongType = errors.New("cms/protocol: wrong choice or any type") + func BER2DER(ber []byte) ([]byte, error) + func NewIssuerAndSerialNumber(cert *x509.Certificate) (rv asn1.RawValue, err error) + type ASN1Error struct + Message string + func (err ASN1Error) Error() string + type AnySet struct + Elements []asn1.RawValue + func DecodeAnySet(rv asn1.RawValue) (as AnySet, err error) + func NewAnySet(elts ...asn1.RawValue) AnySet + func (as AnySet) Encode(dst *asn1.RawValue) (err error) + type Attribute struct + RawValue asn1.RawValue + Type asn1.ObjectIdentifier + func NewAttribute(typ asn1.ObjectIdentifier, val interface{}) (attr Attribute, err error) + func (a Attribute) Value() (AnySet, error) + type Attributes []Attribute + func (attrs Attributes) GetOnlyAttributeValueBytes(oid asn1.ObjectIdentifier) (rv asn1.RawValue, err error) + func (attrs Attributes) GetValues(oid asn1.ObjectIdentifier) ([]AnySet, error) + func (attrs Attributes) HasAttribute(oid asn1.ObjectIdentifier) bool + func (attrs Attributes) MarshaledForSigning() ([]byte, error) + func (attrs Attributes) MarshaledForVerification() ([]byte, error) + type ContentInfo struct + Content asn1.RawValue + ContentType asn1.ObjectIdentifier + func ParseContentInfo(ber []byte) (ci ContentInfo, err error) + func (ci ContentInfo) SignedDataContent() (*SignedData, error) + type EncapsulatedContentInfo struct + EContent asn1.RawValue + EContentType asn1.ObjectIdentifier + func NewDataEncapsulatedContentInfo(data []byte) (EncapsulatedContentInfo, error) + func NewEncapsulatedContentInfo(contentType asn1.ObjectIdentifier, content []byte) (EncapsulatedContentInfo, error) + func (eci EncapsulatedContentInfo) DataEContent() ([]byte, error) + func (eci EncapsulatedContentInfo) EContentValue() ([]byte, error) + func (eci EncapsulatedContentInfo) IsTypeData() bool + type IssuerAndSerialNumber struct + Issuer asn1.RawValue + SerialNumber *big.Int + type SignedData struct + CRLs []asn1.RawValue + Certificates []asn1.RawValue + DigestAlgorithms []pkix.AlgorithmIdentifier + EncapContentInfo EncapsulatedContentInfo + SignerInfos []SignerInfo + Version int + func NewSignedData(eci EncapsulatedContentInfo) (*SignedData, error) + func (sd *SignedData) AddCertificate(cert *x509.Certificate) error + func (sd *SignedData) AddSignerInfo(chain []*x509.Certificate, signer crypto.Signer) error + func (sd *SignedData) ClearCertificates() + func (sd *SignedData) ContentInfo() (ContentInfo, error) + func (sd *SignedData) ContentInfoDER() ([]byte, error) + func (sd *SignedData) X509Certificates() ([]*x509.Certificate, error) + type SignerInfo struct + DigestAlgorithm pkix.AlgorithmIdentifier + SID asn1.RawValue + Signature []byte + SignatureAlgorithm pkix.AlgorithmIdentifier + SignedAttrs Attributes + UnsignedAttrs Attributes + Version int + func (si SignerInfo) FindCertificate(certs []*x509.Certificate) (*x509.Certificate, error) + func (si SignerInfo) GetContentTypeAttribute() (asn1.ObjectIdentifier, error) + func (si SignerInfo) GetMessageDigestAttribute() ([]byte, error) + func (si SignerInfo) GetSigningTimeAttribute() (time.Time, error) + func (si SignerInfo) Hash() (crypto.Hash, error) + func (si SignerInfo) X509SignatureAlgorithm() x509.SignatureAlgorithm