Versions in this module Expand all Collapse all v0 v0.1.1 Nov 3, 2019 v0.1.0 Nov 3, 2019 Changes in this version + var ErrNoCertificate = errors.New("no certificate found") + var ErrNoKeyFound = errors.New("no key for decryption found") + var ErrTrailingData = ASN1Error + var ErrUnsupported = ASN1Error + var ErrUnsupportedAlgorithm = errors.New("cms: cannot decrypt data: unsupported algorithm") + var ErrWrongType = errors.New("cms/protocol: wrong choice or any type") + func ANSIx963KDF(sharedSecret, sharedInfo []byte, keyLen int, hash crypto.Hash) (key []byte, err error) + func ECDHsharedSecret(curve elliptic.Curve, priv []byte, pubX, pubY *big.Int) []byte + func IASstring(cert *x509.Certificate) (iasString string, err error) + func RawValue(val interface{}, params ...string) (rv asn1.RawValue, err error) + type ASN1Error struct + Message string + func (err ASN1Error) Error() string + type Attribute struct + RawValue []asn1.RawValue + Type asn1.ObjectIdentifier + func NewAttribute(attrType asn1.ObjectIdentifier, val interface{}) (attr Attribute, err error) + type Attributes []Attribute + func (attrs Attributes) GetOnlyAttributeValueBytes(oid asn1.ObjectIdentifier) (rv asn1.RawValue, err error) + func (attrs Attributes) GetValues(oid asn1.ObjectIdentifier) ([][]asn1.RawValue, error) + type AuthEnvelopedData struct + AECI EncryptedContentInfo + AauthAttrs []Attribute + MAC []byte + OriginatorInfo asn1.RawValue + RecipientInfos []RecipientInfo + UnAauthAttrs []Attribute + Version int + func NewAuthEnvelopedData(eci *EncryptedContentInfo, reciInfos []RecipientInfo, mac []byte) AuthEnvelopedData + func (ed *AuthEnvelopedData) Decrypt(keyPair []tls.Certificate) (plain []byte, err error) + func (ed AuthEnvelopedData) ContentInfo() (ContentInfo, error) + type CertificateChoices struct + Cert x509.Certificate + Other OtherCertificateFormat + V2AttrCert asn1.RawValue + type ContentInfo struct + Content asn1.RawValue + ContentType asn1.ObjectIdentifier + func ParseContentInfo(der []byte) (ci ContentInfo, err error) + func (ci ContentInfo) AuthEnvelopedDataContent() (*AuthEnvelopedData, error) + func (ci ContentInfo) Base64() ([]byte, error) + func (ci ContentInfo) DER() ([]byte, error) + func (ci ContentInfo) EnvelopedDataContent() (*EnvelopedData, error) + func (ci ContentInfo) SignedDataContent() (*SignedData, error) + type ECCCMSSharedInfo struct + EntityUInfo []byte + KeyInfo pkix.AlgorithmIdentifier + SuppPubInfo []byte + type EncapsulatedContentInfo struct + EContent []byte + EContentType asn1.ObjectIdentifier + func NewDataEncapsulatedContentInfo(data []byte) (EncapsulatedContentInfo, error) + func NewEncapsulatedContentInfo(contentType asn1.ObjectIdentifier, content []byte) (EncapsulatedContentInfo, error) + func (eci EncapsulatedContentInfo) IsTypeData() bool + type EncryptedContentInfo struct + ContentEncryptionAlgorithm pkix.AlgorithmIdentifier + EContent []byte + EContentType asn1.ObjectIdentifier + func NewEncryptedContentInfo(contentType asn1.ObjectIdentifier, contentEncryptionAlg asn1.ObjectIdentifier, ...) (eci EncryptedContentInfo, key, mac []byte, err error) + type EnvelopedData struct + ECI EncryptedContentInfo + OriginatorInfo asn1.RawValue + RecipientInfos []RecipientInfo + UnprotectedAttrs []Attribute + Version int + func NewEnvelopedData(eci *EncryptedContentInfo, reciInfos []RecipientInfo) EnvelopedData + func (ed *EnvelopedData) Decrypt(keyPairs []tls.Certificate) (plain []byte, err error) + func (ed EnvelopedData) ContentInfo() (ContentInfo, error) + type IssuerAndSerialNumber struct + Issuer asn1.RawValue + SerialNumber *big.Int + func NewIssuerAndSerialNumber(cert *x509.Certificate) (sid IssuerAndSerialNumber, err error) + func (ias *IssuerAndSerialNumber) Equal(ias2 IssuerAndSerialNumber) bool + func (ias *IssuerAndSerialNumber) RawValue() (rv asn1.RawValue, err error) + type KeyAgreeRecipientIdentifier struct + IAS IssuerAndSerialNumber + RKeyID RecipientKeyIdentifier + type KeyAgreeRecipientInfo struct + KeyEncryptionAlgorithm pkix.AlgorithmIdentifier + Originator OriginatorIdentifierOrKey + RecipientEncryptedKeys []RecipientEncryptedKey + UKM []byte + Version int + type KeyTransRecipientInfo struct + EncryptedKey []byte + KeyEncryptionAlgorithm pkix.AlgorithmIdentifier + Rid RecipientIdentifier + Version int + type OriginatorIdentifierOrKey struct + IAS IssuerAndSerialNumber + OriginatorKey OriginatorPublicKey + SKI []byte + type OriginatorPublicKey struct + Algorithm pkix.AlgorithmIdentifier + PublicKey asn1.BitString + type OtherCertificateFormat struct + OtherCert asn1.RawValue + OtherCertFormat asn1.ObjectIdentifier + type OtherKeyAttribute struct + KeyAttr asn1.RawValue + KeyAttrID asn1.ObjectIdentifier + type OtherRevocationInfoFormat struct + OtherRevInfo asn1.RawValue + OtherRevInfoFormat asn1.ObjectIdentifier + type RSAESOAEPparams struct + HashFunc pkix.AlgorithmIdentifier + MaskGenFunc pkix.AlgorithmIdentifier + PSourceFunc pkix.AlgorithmIdentifier + type RecipientEncryptedKey struct + EncryptedKey []byte + RID KeyAgreeRecipientIdentifier + type RecipientIdentifier struct + IAS IssuerAndSerialNumber + SKI []byte + type RecipientInfo struct + KARI KeyAgreeRecipientInfo + KEKRI asn1.RawValue + KTRI KeyTransRecipientInfo + ORI asn1.RawValue + PWRI asn1.RawValue + func NewRecipientInfo(recipient *x509.Certificate, key []byte) (info RecipientInfo, err error) + type RecipientKeyIdentifier struct + Date time.Time + Other OtherKeyAttribute + SubjectKeyIdentifier []byte + type RevocationInfoChoice struct + Crl pkix.CertificateList + Other OtherRevocationInfoFormat + type SignedData struct + CRLs []RevocationInfoChoice + Certificates []asn1.RawValue + DigestAlgorithms []pkix.AlgorithmIdentifier + EncapContentInfo EncapsulatedContentInfo + SignerInfos []SignerInfo + Version int + func NewSignedData(eci EncapsulatedContentInfo) (*SignedData, error) + func (sd *SignedData) AddCertificate(cert []byte) error + func (sd *SignedData) AddSignerInfo(keypPair tls.Certificate, attrs []Attribute) (err error) + func (sd *SignedData) ClearCertificates() + func (sd *SignedData) ContentInfo() (ContentInfo, error) + func (sd *SignedData) Verify(Opts x509.VerifyOptions, detached []byte) (chains [][][]*x509.Certificate, err error) + func (sd *SignedData) X509Certificates() (map[string]*x509.Certificate, error) + type SignerIdentifier struct + IAS IssuerAndSerialNumber + SKI []byte + type SignerInfo struct + DigestAlgorithm pkix.AlgorithmIdentifier + SID SignerIdentifier + Signature []byte + SignatureAlgorithm pkix.AlgorithmIdentifier + SignedAttrs []Attribute + UnsignedAttrs []Attribute + 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() (sigAlg x509.SignatureAlgorithm, err error)