Function c509_certificate::generate

source ·
pub fn generate(
    tbs_cert: &TbsCert,
    private_key: Option<&PrivateKey>,
) -> Result<Vec<u8>>
Expand description

Generate a signed or unsigned C509 certificate.

§Arguments

  • tbs_cert - A TBS certificate.
  • private_key - An optional private key, if provided certificate is signed.

§Returns

Returns a signed or unsigned C509 certificate.

§Errors

Returns an error if tne data cannot be converted to CBOR bytes.