pub fn generate_tls_key_pair(
    common_name: &str,
    serial: [u8; 19],
    not_after: &Asn1Time,
) -> (X509, PKey<Private>) {
    let key_pair = ed25519_key_pair();
    let x509_certificate = x509_v3_certificate(
        common_name,
        serial,
        &key_pair,
        not_after,
        // Digest must be null for Ed25519 (see https://www.openssl.org/docs/man1.1.1/man7/Ed25519.html)
        MessageDigest::null(),
    );
    (x509_certificate, key_pair)
}
/// Generate a key pair and return the certificate and private key.
///
/// Note that the certificate serial number must be at most 20 octets according
/// to https://tools.ietf.org/html/rfc5280 Section 4.1.2.2. The 19 bytes serial
/// number argument is interpreted as an unsigned integer and thus fits in 20
/// bytes, encoded as a signed ASN1 integer.
Generate a key pair and return the certificate and private key.
Generate a key pair and return the certificate and private key .
pub fn generate_tls_key_pair(
    common_name: &str,
    serial: [u8; 19],
    not_after: &Asn1Time,
) -> (X509, PKey<Private>) {
    let key_pair = ed25519_key_pair();
    let x509_certificate = x509_v3_certificate(
        common_name,
        serial,
        &key_pair,
        not_after,
        // Digest must be null for Ed25519 (see https://www.openssl.org/docs/man1.1.1/man7/Ed25519.html)
        MessageDigest::null(),
    );
    (x509_certificate, key_pair)
}
pub fn generate_tls_key_pair ( common_name : & str , serial : [ u8 ; 19 ] , not_after : & Asn1Time , ) -> ( X509 , PKey < Private > ) { let key_pair = ed25519_key_pair ( ) ; let x509_certificate = x509_v3_certificate ( common_name , serial , & key_pair , not_after , // Digest must be null for Ed25519 (see https://www.openssl.org/docs/man1.1.1/man7/Ed25519.html) MessageDigest :: null ( ) , ) ; ( x509_certificate , key_pair ) }
Generate a key pair and return the certificate and private key.
Generate a key pair and return the certificate and private key .
common_name
&str
serial
[u8; 19]
not_after
&Asn1Time
common_name
&str
serial
[u8; 19]
not_after
&Asn1Time