Function generate_self_signed_device_cert

Source
pub fn generate_self_signed_device_cert(
    node_id: &str,
    device: &str,
    subject_alt_names: Vec<String>,
    key_pair: Option<KeyPair>,
) -> Certificate
Expand description

Generate a new device certificate from a fresh set of keys. The path in the common name (CN) field is “/users/{node_id}/{device}”. This certificate is self signed and needs to be signed off by the users certificate authority to be valid. This certificate can not act as a ca and sign sub certificates. It can take an optional key pair to create the certificate from instead of generating a key pair from scratch.