Cmsex.AuthenticatedData (cmsex v0.1.0)

Copy Markdown View Source

An AuthenticatedData message, as Cmsex.decode/2 reads it (RFC 5652, 9): a content and a MAC over it, with the MAC key sent to each recipient as in EnvelopedData. The content is not encrypted. Cmsex.verify_mac/2 checks it.

Fields:

  • :version - the version written in the message.
  • :recipient_infos - the recipients, a list of Cmsex.RecipientInfo.
  • :mac_algorithm - the name of the MAC algorithm, such as :hmac_sha256, or its OID.
  • :digest_algorithm - the name of the digest algorithm of the message-digest attribute, or nil when there are no authenticated attributes.
  • :content_type - the type of the content, as a name of Cmsex.OID or an OID.
  • :content - the content, or nil when it is not in the message.
  • :pkcs7_content - as in Cmsex.SignedData.
  • :certificates, :other_certificates, :crls, :other_crls - the OriginatorInfo, empty when it is absent.
  • :authenticated_attributes - the attributes the MAC covers, a list of Cmsex.Attribute, or nil.
  • :mac - the MAC.
  • :unauthenticated_attributes - attributes the MAC does not cover, empty when there are none.
  • :deviations - :auth_data_version when the version is not the one the fields call for. The recipients have their own.

Summary

Types

t()

@type t() :: %Cmsex.AuthenticatedData{
  authenticated_attributes: [Cmsex.Attribute.t()] | nil,
  certificates: [binary()],
  content: binary() | nil,
  content_type: atom() | tuple(),
  crls: [binary()],
  deviations: [atom()],
  digest_algorithm: atom() | tuple() | nil,
  mac: binary(),
  mac_algorithm: atom() | tuple(),
  other_certificates: [binary()],
  other_crls: [binary()],
  pkcs7_content: binary() | nil,
  raw: map() | nil,
  recipient_infos: [Cmsex.RecipientInfo.t()],
  unauthenticated_attributes: [Cmsex.Attribute.t()],
  version: integer()
}