Skip to main content

generate_key_pair

Function generate_key_pair 

Source
pub fn generate_key_pair(
    key_type: &KeyType,
    config: &KeyGenConfig,
) -> Result<KeyGenResult, KeyGenError>
Expand description

Generate a key pair for the EST /serverkeygen endpoint.

Per NIAP CA PP FCS_CKM.1, uses approved key generation methods. The private key is returned in PKCS#8 DER format for wrapping in CMS EnvelopedData before delivery to the client.

§Arguments

  • key_type - Requested key type and size
  • config - Key generation configuration

§Returns

KeyGenResult containing the public key (for cert issuance) and private key (for client delivery).