Import and Export Keys
A Key can be generated in a Token Profile, imported into it from a file, and exported from it later. Import and export need a Token Profile whose token was created on a Cryptography Provider v2 connector that supports them. The Software Cryptography Provider supports both, and the PKCS#11 Cryptography Provider neither. A token created on Cryptography Provider v1 stays on v1 after its connector is upgraded and supports neither, so create a new token to use them. They are offered only for the key types and algorithms the provider supports; see Import and export.
Create or import a key
- Click Keys in the left menu
- Click Create Key (plus symbol )
- When you hold the
importKeypermission onkeys, the form has the Generate new and Import material tabs. Without it, the form only generates a key.
Generate new creates the key in the selected Token Profile. The key is created disabled; enable it before it is used. When the profile's provider exports the key's type, the form shows the Exportable switch; see exportable keys.
Import material reads a file into the selected Token Profile in the same way as importing certificates and keys: the file, its password when it is protected, the entries it holds, the key's name, the Exportable switch and the provider's import attributes. Certificates found in the file can be imported with the key.
Export a key
- Open the
Keyand select its private or secret key item - Click Export (download symbol ). A new key is disabled, so click Enable on the item first.
- In Export key material, the Format is Encrypted PKCS8 – private key (PEM) for a private key, or Encrypted PKCS8 – secret key (PEM) for a secret key
- Enter the Password and Confirm password. The password needs at least 12 characters.
- Fill in the provider's export attributes, when it has any
- Click Export
The file is a PEM ENCRYPTED PRIVATE KEY block, named after the key item. The cryptography provider protects the key under the password, and the platform never decrypts it.
The Export action is offered, and the export succeeds, only when:
- the key item was created or imported as exportable
- the key item is active and enabled
- the
Token Profileexports the key's algorithm - you hold the
exportKeypermission onkeys, among the permissions an export needs
The provider can still refuse an export; the platform then names the provider's error code.