# README
cms/protocol 
cms/protocol implements low-level parsing of CMS (PKCS#7) data.
This package is based off https://github.com/fullsailor/pkcs7 and contains the license from that repository.
# Functions
BER2DER attempts to convert BER encoded data to DER encoding.
DecodeAnySet manually decodes a SET OF ANY type, since Go's parser can't handle them.
NewAnySet creates a new AnySet.
NewAttribute creates a single-value Attribute.
NewDataEncapsulatedContentInfo creates a new EncapsulatedContentInfo of type id-data.
NewEncapsulatedContentInfo creates a new EncapsulatedContentInfo.
NewIssuerAndSerialNumber creates a IssuerAndSerialNumber SID for the given cert.
NewSignedData creates a new SignedData.
ParseContentInfo parses a top-level ContentInfo type from BER encoded data.
# Variables
ErrNoCertificate is returned when a requested certificate cannot be found.
ErrTrailingData is returned when extra data is found after parsing an ASN.1 structure.
ErrUnsupported is returned when an unsupported type or version is encountered.
ErrWrongType is returned by methods that make assumptions about types.
# Structs
AnySet is a helper for dealing with SET OF ANY types.
ASN1Error is an error from parsing ASN.1 structures.
Attribute ::= SEQUENCE { attrType OBJECT IDENTIFIER, attrValues SET OF AttributeValue }
AttributeValue ::= ANY.
ContentInfo ::= SEQUENCE { contentType ContentType, content [0] EXPLICIT ANY DEFINED BY contentType }
ContentType ::= OBJECT IDENTIFIER.
EncapsulatedContentInfo ::= SEQUENCE { eContentType ContentType, eContent [0] EXPLICIT OCTET STRING OPTIONAL }
ContentType ::= OBJECT IDENTIFIER.
IssuerAndSerialNumber ::= SEQUENCE { issuer Name, serialNumber CertificateSerialNumber }
CertificateSerialNumber ::= INTEGER.
SignedData ::= SEQUENCE { version CMSVersion, digestAlgorithms DigestAlgorithmIdentifiers, encapContentInfo EncapsulatedContentInfo, certificates [0] IMPLICIT CertificateSet OPTIONAL, crls [1] IMPLICIT RevocationInfoChoices OPTIONAL, signerInfos SignerInfos }
CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4), v5(5) }
DigestAlgorithmIdentifiers ::= SET OF DigestAlgorithmIdentifier
CertificateSet ::= SET OF CertificateChoices
CertificateChoices ::= CHOICE { certificate Certificate, extendedCertificate [0] IMPLICIT ExtendedCertificate, -- Obsolete v1AttrCert [1] IMPLICIT AttributeCertificateV1, -- Obsolete v2AttrCert [2] IMPLICIT AttributeCertificateV2, other [3] IMPLICIT OtherCertificateFormat }
OtherCertificateFormat ::= SEQUENCE { otherCertFormat OBJECT IDENTIFIER, otherCert ANY DEFINED BY otherCertFormat }
RevocationInfoChoices ::= SET OF RevocationInfoChoice
RevocationInfoChoice ::= CHOICE { crl CertificateList, other [1] IMPLICIT OtherRevocationInfoFormat }
OtherRevocationInfoFormat ::= SEQUENCE { otherRevInfoFormat OBJECT IDENTIFIER, otherRevInfo ANY DEFINED BY otherRevInfoFormat }
SignerInfos ::= SET OF SignerInfo.
SignerInfo ::= SEQUENCE { version CMSVersion, sid SignerIdentifier, digestAlgorithm DigestAlgorithmIdentifier, signedAttrs [0] IMPLICIT SignedAttributes OPTIONAL, signatureAlgorithm SignatureAlgorithmIdentifier, signature SignatureValue, unsignedAttrs [1] IMPLICIT UnsignedAttributes OPTIONAL }
CMSVersion ::= INTEGER { v0(0), v1(1), v2(2), v3(3), v4(4), v5(5) }
SignerIdentifier ::= CHOICE { issuerAndSerialNumber IssuerAndSerialNumber, subjectKeyIdentifier [0] SubjectKeyIdentifier }
DigestAlgorithmIdentifier ::= AlgorithmIdentifier
SignedAttributes ::= SET SIZE (1..MAX) OF Attribute
SignatureAlgorithmIdentifier ::= AlgorithmIdentifier
SignatureValue ::= OCTET STRING
UnsignedAttributes ::= SET SIZE (1..MAX) OF Attribute.
# Type aliases
Attributes is a common Go type for SignedAttributes and UnsignedAttributes.