1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright lowRISC contributors (OpenTitan project).
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0

//! This crate handles generating OpenTitan certificates.
//!
//! These certificates are generated from a template and embedded onto an
//! OpenTitan device.
//!
//! Templates may specify that some values are variables, in which case they
//! will be filled in by the device itself. This crate will generate C code for
//! setting/getting variable values of templates from OpenTitan firmware.
//!
//! Certificates are generated in both X.509 format and CWT (CBOR web token)
//! format. Details of the certificates will be available in the documentation
//! in the future.

pub mod asn1;
pub mod cbor;
pub mod codegen;
pub mod cwt;
pub mod template;
pub mod x509;

use clap::ValueEnum;

/// Supported OpenTitan certificate formats.
#[derive(Clone, Debug, ValueEnum)]
pub enum CertFormat {
    X509,
    Cwt,
}