key_algorithm Property
This property holds the algorithm associated with the key.
Syntax
def get_key_algorithm() -> int: ... def set_key_algorithm(value: int) -> None: ...
key_algorithm = property(get_key_algorithm, set_key_algorithm)
Default Value
0
Remarks
This property holds the algorithm associated with the key. Possible values are:
- 0 (eaSecp256r1)
- 1 (eaSecp384r1)
- 2 (eaSecp521r1)
- 3 (eaEd25519)
- 4 (eaEd448)
- 5 (eaX25519)
- 6 (eaX448)
- 7 (eaSecp160k1)
- 8 (eaSecp192k1)
- 9 (eaSecp224k1)
- 10 (eaSecp256k1)
When assigning a key using the PEM formatted key_private_key and key_public_key the key_algorithm property will be automatically updated with the key algorithm.
When assigning a key using the raw key parameters (keyk, key_rx, and key_ry for NIST or key_x_pk, and key_x_sk for Curve25519/Curve448) the key_algorithm property must be set manually to the key algorithm.
The following table summarizes the supported operations for keys created with each algorithm:
KeyAlgorithm | Supported Operations |
secp256r1 | ECDH/ECIES/ECDSA (on_compute_secret, on_encrypt, on_decrypt, on_sign, and on_verify_signature) |
secp384r1 | ECDH/ECIES/ECDSA (on_compute_secret, on_encrypt, on_decrypt, on_sign, and on_verify_signature) |
secp521r1 | ECDH/ECIES/ECDSA (on_compute_secret, on_encrypt, on_decrypt, on_sign, and on_verify_signature) |
x25519 | ECDH (on_compute_secret) |
x448 | ECDH (on_compute_secret) |
ed25519 | EdDSA (on_sign and on_verify_signature) |
ed448 | EdDSA (on_sign and on_verify_signature) |
eaSecp160k1 | ECDH/ECIES/ECDSA (on_compute_secret, on_encrypt, on_decrypt, on_sign, and on_verify_signature) |
eaSecp192k1 | ECDH/ECIES/ECDSA (on_compute_secret, on_encrypt, on_decrypt, on_sign, and on_verify_signature) |
eaSecp224k1 | ECDH/ECIES/ECDSA (on_compute_secret, on_encrypt, on_decrypt, on_sign, and on_verify_signature) |
eaSecp256k1 | ECDH/ECIES/ECDSA (on_compute_secret, on_encrypt, on_decrypt, on_sign, and on_verify_signature) |