Cmsex.SignedData (cmsex v0.1.0)

Copy Markdown View Source

A SignedData message, as Cmsex.decode/2 reads it (RFC 5652, 5). Reading checks the structure only; Cmsex.verify/2 checks the signatures.

Fields:

  • :version - the version written in the message.
  • :content_type - the type of the signed content (eContentType), as a name of Cmsex.OID, such as :data or :tst_info, or an OID.
  • :content - the signed content, or nil for a detached signature. It is the value of the eContent OCTET STRING, its segments joined when the message was written in BER. For a PKCS #7 message whose content is not an OCTET STRING (RFC 5652, 5.2.1), it is the content octets of that value, which is what the signature covers.
  • :pkcs7_content - for such a PKCS #7 message, the whole encoding of the content; nil otherwise.
  • :digest_algorithms - the digestAlgorithms field, as names or OIDs. Verification does not depend on it.
  • :certificates - the X.509 certificates of the message, in DER, in the order of the message. They are not trusted for being there.
  • :other_certificates - the other choices of CertificateChoices (attribute certificates, other formats), each as received.
  • :crls - the certificate revocation lists, in DER.
  • :other_crls - other revocation information (RFC 5652, 10.2.1), each as received.
  • :signer_infos - the signers, a list of Cmsex.SignerInfo. Empty in a certificate bundle.
  • :deviations - what the library tolerated when reading, against RFC 5652: :signed_data_version when the version is not the one the fields call for (section 5.1). The signers have their own.

Summary

Types

t()

@type t() :: %Cmsex.SignedData{
  certificates: [binary()],
  content: binary() | nil,
  content_type: atom() | tuple(),
  crls: [binary()],
  deviations: [atom()],
  digest_algorithms: [atom() | tuple()],
  other_certificates: [binary()],
  other_crls: [binary()],
  pkcs7_content: binary() | nil,
  raw: map() | nil,
  signer_infos: [Cmsex.SignerInfo.t()],
  version: integer()
}