signer.util.keygenΒΆ

This File contains functions to create Public and Private Keys.

FunctionsΒΆ

generate_private_key(algorithm_oid_str, curve_name, ...)

This Function generates a Private Key. Which later on is used to get public Key.

load_private_key_object(pem_str)

This function loads a private key from PEM format.

Module ContentsΒΆ

signer.util.keygen.generate_private_key(algorithm_oid_str, curve_name, key_size)[source]ΒΆ

This Function generates a Private Key. Which later on is used to get public Key.

Parameters:
  • algorithm_oid_str (str) – oid string of the algorithm to use.

  • curve_name (str | None) – curve name which is used to generate the private key (either of two is used).

  • key_size (int | None) – length of the private key (either of two is used).

Returns:

Gives out the private key. In string pem format.

Return type:

str

signer.util.keygen.load_private_key_object(pem_str)[source]ΒΆ

This function loads a private key from PEM format.

Parameters:

pem_str (str)

Return type:

trustpoint_core.crypto_types.PrivateKey