Module ot_certs::template

source ·
Expand description

OpenTitan certificate template deserialization.

This module contains structs defining certificate templates.

These structs are defined in Hjson files and deserialized to here. Any extra conversion required (beyond simple renaming) is done in the hjson module.

The format for a template in Hjson looks something like:

{
  variables: {
    SomeVariableName: {
      type: "byte-array",
      size: 20,
    },
    // ...
  },

  certificate: {
    // Certificate keys, some making use of variables, others not.
    serial_number: { var: "SomeVariableName" },
    layer: 0,
    // ...
  }
}

Modules

  • This module defines substitution data that can be used to replace the variables in a template by actual values.
  • This module provides functionality to generate substitute data for template to test corner cases of the certificate generator.

Structs

Enums

Type Definitions

  • An X501 Name (or DistinguishedName, aka DN): a DN consists of a sequence of RelativeDistinguishedName (RDN). An RDN is an ordered set of attribute type and value pairs. Within an RDN, each attribute type can only appear once. Therefore, we represent a name as a vector of RDN, and each RDN is represented by a map. The order of the vector is important: changing the order changes the name. The order within the map is not important but we use an IndexMap to make the consumers of this template use a deterministic order.