API Reference cmsex v#0.1.0

Copy Markdown View Source

Modules

Cryptographic Message Syntax (CMS, RFC 5652) in pure Elixir: the signed, encrypted and other messages of S/MIME, of .p7s, .p7m and .p7b files, and of the many systems built on them.

A signed or unsigned attribute of a signer (RFC 5652, 5.3): a type and its values.

An AuthenticatedData message whose MAC Cmsex.verify_mac/2 checked.

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.

A message that Cmsex.decrypt/2 decrypted.

A DigestedData message, as Cmsex.decode/2 reads it (RFC 5652, 7): a content and its digest, which shows it was not changed by accident, and nothing more: anyone can write a new digest. Cmsex.verify_digest/2 checks it.

An EncryptedData message, as Cmsex.decode/2 reads it (RFC 5652, 8): content encrypted with a key the parties manage by other means, with no recipients. Cmsex.decrypt/2 with :content_key decrypts it.

An EnvelopedData (RFC 5652, 6) or AuthEnvelopedData (RFC 5083) message, as Cmsex.decode/2 reads it. Reading checks the structure only; Cmsex.decrypt/2 decrypts.

Why a CMS message could not be read, verified, written or decrypted.

The AES key wrap of RFC 3394, and AES key wrap with padding of RFC 5649.

The object identifiers this library knows by name.

The textual encoding of CMS messages (RFC 7468): Base64 between -----BEGIN CMS----- and -----END CMS----- lines.

A recipient for Cmsex.encrypt/3 and Cmsex.mac/3: who can decrypt the message, or check its MAC, and how the key reaches them (RFC 5652, 6.2). Build it with one of the functions here; both functions also take a certificate in DER as a recipient of certificate/2 with the defaults.

One recipient of an EnvelopedData, AuthEnvelopedData or AuthenticatedData message, as Cmsex.decode/2 reads it (RFC 5652, 6.2): the means by which that recipient gets the content-encryption key.

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

A signer for Cmsex.sign/3: a certificate, its private key, and how to sign. Cmsex.sign/3 also takes it as a plain map or keyword list with the same fields, and turns it into this struct, whose Inspect leaves the key out.

One signer of a SignedData message, as Cmsex.decode/2 reads it (RFC 5652, 5.3). Reading checks the structure only; Cmsex.verify/2 checks the signature.