# `Cmsex.OID`
[🔗](https://github.com/openspb/cmsex/blob/v0.1.0/lib/cmsex/oid.ex#L1)

The object identifiers this library knows by name.

Everywhere in the API an OID is a tuple of integers, such as
`{1, 2, 840, 113549, 1, 7, 1}`, and a known one may also be given and is
returned as its name, such as `:data`. Names come only from this fixed
table: an OID read from a message that is not in it stays a tuple, so no
input can create atoms.

| Name | OID |
|---|---|
| `:data` | 1.2.840.113549.1.7.1 |
| `:signed_data` | 1.2.840.113549.1.7.2 |
| `:enveloped_data` | 1.2.840.113549.1.7.3 |
| `:digested_data` | 1.2.840.113549.1.7.5 |
| `:encrypted_data` | 1.2.840.113549.1.7.6 |
| `:auth_data` | 1.2.840.113549.1.9.16.1.2 |
| `:tst_info` | 1.2.840.113549.1.9.16.1.4 |
| `:content_info` | 1.2.840.113549.1.9.16.1.6 |
| `:auth_enveloped_data` | 1.2.840.113549.1.9.16.1.23 |
| `:content_type` | 1.2.840.113549.1.9.3 |
| `:message_digest` | 1.2.840.113549.1.9.4 |
| `:signing_time` | 1.2.840.113549.1.9.5 |
| `:countersignature` | 1.2.840.113549.1.9.6 |
| `:smime_capabilities` | 1.2.840.113549.1.9.15 |
| `:cms_algorithm_protection` | 1.2.840.113549.1.9.52 |
| `:content_hint` | 1.2.840.113549.1.9.16.2.4 |
| `:signing_certificate` | 1.2.840.113549.1.9.16.2.12 |
| `:time_stamp_token` | 1.2.840.113549.1.9.16.2.14 |
| `:sig_policy_id` | 1.2.840.113549.1.9.16.2.15 |
| `:signing_certificate_v2` | 1.2.840.113549.1.9.16.2.47 |
| `:md5` | 1.2.840.113549.2.5 |
| `:sha1` | 1.3.14.3.2.26 |
| `:sha224` | 2.16.840.1.101.3.4.2.4 |
| `:sha256` | 2.16.840.1.101.3.4.2.1 |
| `:sha384` | 2.16.840.1.101.3.4.2.2 |
| `:sha512` | 2.16.840.1.101.3.4.2.3 |
| `:shake128` | 2.16.840.1.101.3.4.2.11 |
| `:shake256` | 2.16.840.1.101.3.4.2.12 |
| `:shake128_len` | 2.16.840.1.101.3.4.2.17 |
| `:shake256_len` | 2.16.840.1.101.3.4.2.18 |
| `:rsa_encryption` | 1.2.840.113549.1.1.1 |
| `:md5_with_rsa_encryption` | 1.2.840.113549.1.1.4 |
| `:sha1_with_rsa_encryption` | 1.2.840.113549.1.1.5 |
| `:rsaes_oaep` | 1.2.840.113549.1.1.7 |
| `:mgf1` | 1.2.840.113549.1.1.8 |
| `:p_specified` | 1.2.840.113549.1.1.9 |
| `:rsassa_pss` | 1.2.840.113549.1.1.10 |
| `:sha256_with_rsa_encryption` | 1.2.840.113549.1.1.11 |
| `:sha384_with_rsa_encryption` | 1.2.840.113549.1.1.12 |
| `:sha512_with_rsa_encryption` | 1.2.840.113549.1.1.13 |
| `:sha224_with_rsa_encryption` | 1.2.840.113549.1.1.14 |
| `:ec_public_key` | 1.2.840.10045.2.1 |
| `:ecdsa_with_sha1` | 1.2.840.10045.4.1 |
| `:ecdsa_with_sha224` | 1.2.840.10045.4.3.1 |
| `:ecdsa_with_sha256` | 1.2.840.10045.4.3.2 |
| `:ecdsa_with_sha384` | 1.2.840.10045.4.3.3 |
| `:ecdsa_with_sha512` | 1.2.840.10045.4.3.4 |
| `:secp256r1` | 1.2.840.10045.3.1.7 |
| `:secp384r1` | 1.3.132.0.34 |
| `:secp521r1` | 1.3.132.0.35 |
| `:brainpool_p256r1` | 1.3.36.3.3.2.8.1.1.7 |
| `:brainpool_p384r1` | 1.3.36.3.3.2.8.1.1.11 |
| `:brainpool_p512r1` | 1.3.36.3.3.2.8.1.1.13 |
| `:x25519` | 1.3.101.110 |
| `:x448` | 1.3.101.111 |
| `:ed25519` | 1.3.101.112 |
| `:ed448` | 1.3.101.113 |
| `:std_dh_sha1kdf` | 1.3.133.16.840.63.0.2 |
| `:cofactor_dh_sha1kdf` | 1.3.133.16.840.63.0.3 |
| `:std_dh_sha224kdf` | 1.3.132.1.11.0 |
| `:std_dh_sha256kdf` | 1.3.132.1.11.1 |
| `:std_dh_sha384kdf` | 1.3.132.1.11.2 |
| `:std_dh_sha512kdf` | 1.3.132.1.11.3 |
| `:cofactor_dh_sha224kdf` | 1.3.132.1.14.0 |
| `:cofactor_dh_sha256kdf` | 1.3.132.1.14.1 |
| `:cofactor_dh_sha384kdf` | 1.3.132.1.14.2 |
| `:cofactor_dh_sha512kdf` | 1.3.132.1.14.3 |
| `:std_dh_hkdf_sha256` | 1.2.840.113549.1.9.16.3.19 |
| `:std_dh_hkdf_sha384` | 1.2.840.113549.1.9.16.3.20 |
| `:std_dh_hkdf_sha512` | 1.2.840.113549.1.9.16.3.21 |
| `:dsa` | 1.2.840.10040.4.1 |
| `:dsa_with_sha1` | 1.2.840.10040.4.3 |
| `:dsa_with_sha224` | 2.16.840.1.101.3.4.3.1 |
| `:dsa_with_sha256` | 2.16.840.1.101.3.4.3.2 |
| `:dh_public_number` | 1.2.840.10046.2.1 |
| `:esdh` | 1.2.840.113549.1.9.16.3.5 |
| `:aes128_cbc` | 2.16.840.1.101.3.4.1.2 |
| `:aes192_cbc` | 2.16.840.1.101.3.4.1.22 |
| `:aes256_cbc` | 2.16.840.1.101.3.4.1.42 |
| `:aes128_gcm` | 2.16.840.1.101.3.4.1.6 |
| `:aes192_gcm` | 2.16.840.1.101.3.4.1.26 |
| `:aes256_gcm` | 2.16.840.1.101.3.4.1.46 |
| `:aes128_ccm` | 2.16.840.1.101.3.4.1.7 |
| `:aes192_ccm` | 2.16.840.1.101.3.4.1.27 |
| `:aes256_ccm` | 2.16.840.1.101.3.4.1.47 |
| `:aes128_wrap` | 2.16.840.1.101.3.4.1.5 |
| `:aes192_wrap` | 2.16.840.1.101.3.4.1.25 |
| `:aes256_wrap` | 2.16.840.1.101.3.4.1.45 |
| `:aes128_wrap_pad` | 2.16.840.1.101.3.4.1.8 |
| `:aes192_wrap_pad` | 2.16.840.1.101.3.4.1.28 |
| `:aes256_wrap_pad` | 2.16.840.1.101.3.4.1.48 |
| `:des_ede3_cbc` | 1.2.840.113549.3.7 |
| `:rc2_cbc` | 1.2.840.113549.3.2 |
| `:des_cbc` | 1.3.14.3.2.7 |
| `:cms3des_wrap` | 1.2.840.113549.1.9.16.3.6 |
| `:cmsrc2_wrap` | 1.2.840.113549.1.9.16.3.7 |
| `:chacha20_poly1305` | 1.2.840.113549.1.9.16.3.18 |
| `:pwri_kek` | 1.2.840.113549.1.9.16.3.9 |
| `:pbkdf2` | 1.2.840.113549.1.5.12 |
| `:hmac_sha1` | 1.3.6.1.5.5.8.1.2 |
| `:hmac_with_sha1` | 1.2.840.113549.2.7 |
| `:hmac_sha224` | 1.2.840.113549.2.8 |
| `:hmac_sha256` | 1.2.840.113549.2.9 |
| `:hmac_sha384` | 1.2.840.113549.2.10 |
| `:hmac_sha512` | 1.2.840.113549.2.11 |
| `:subject_key_identifier` | 2.5.29.14 |
| `:key_usage` | 2.5.29.15 |
| `:basic_constraints` | 2.5.29.19 |
| `:authority_key_identifier` | 2.5.29.35 |
| `:ext_key_usage` | 2.5.29.37 |
| `:kp_time_stamping` | 1.3.6.1.5.5.7.3.8 |

# `name`

```elixir
@type name() :: atom()
```

# `t`

```elixir
@type t() :: tuple()
```

# `dotted`

```elixir
@spec dotted(name() | t()) :: String.t()
```

The dotted form of an OID or of a name.

    iex> Cmsex.OID.dotted(:sha256)
    "2.16.840.1.101.3.4.2.1"

# `name`

```elixir
@spec name(t()) :: name() | t()
```

The name of an OID, or the OID itself when it has none.

    iex> Cmsex.OID.name({1, 2, 840, 113549, 1, 7, 2})
    :signed_data
    iex> Cmsex.OID.name({1, 2, 3})
    {1, 2, 3}

# `oid`

```elixir
@spec oid(name() | t()) :: t()
```

The OID of a name, or the OID itself.

    iex> Cmsex.OID.oid(:data)
    {1, 2, 840, 113549, 1, 7, 1}
    iex> Cmsex.OID.oid({1, 2, 3})
    {1, 2, 3}

---

*Consult [api-reference.md](api-reference.md) for complete listing*
