10. Key Management System

Note

KMS is not thread-safe. Please create a new object to use in each thread!

This module uses a custom Key Management System for AES-256 keys.

You need to identify the key with a name and a password.

1from krypton.basic import KMS
2obj = KMS()
3key = obj.createNewKey("KeyName", "password")
4keyAgain = obj.getKey("KeyName", "password")
5## Note getKey raises a krypton.basic.KeyManagementError
6# if the cryptoperiod of the key has expired as  
7# specified in the configs. To get the key
8# anyway, add force=True to the parameters.
9obj.removeKey("KeyName", "password")