__init__

KeyManager.__init__(key: Union[str, bytes, cryptography.hazmat.primitives.asymmetric.rsa.RSAPrivateKeyWithSerialization, cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePrivateKeyWithSerialization, cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PrivateKey, cryptography.hazmat.primitives.asymmetric.rsa.RSAPublicKey, cryptography.hazmat.primitives.asymmetric.ec.EllipticCurvePublicKey, cryptography.hazmat.primitives.asymmetric.ed25519.Ed25519PublicKey], password: Union[str, bytes] = None)[source]

Create an instance of KeyManager using the public/private key data key

If you want to load the key from a file instead of passing it’s data / key class instance, then you should use load_keyfile() instead to create the class instance.

You do NOT need to initialize this class if you’re simply using the class methods / static methods such as generate_keypair() or load_key() - only to use the normal instance methods which require a loaded public/private key, such as sign()

Parameters
  • key – The public/private key data, as either a string, bytes, or one of the various private key class instances or public key class instances (see public_key_types and private_key_types)

  • password (str|bytes) – If your key data is encrypted, pass the password in this argument to decrypt it.