nethsm-key-import(1) General Commands Manual nethsm-key-import(1)

nethsm-key-import - Import a key

nethsm key import [--format] [-k|--key-id] [-t|--tags] [-a|--auth-passphrase-file] [-c|--config] [-l|--label] [-u|--user] [-h|--help] <KEY_TYPE> <KEY_DATA> [KEY_MECHANISMS]

Import a key

The provided key data must be provided as PKCS#8 private key in ASN.1 Distinguished Encoding Rules (DER) encoded or Privacy-Enhanced Mail (PEM) format. The key data must match the provided key type.

The provided key type and list of key mechanisms have to match: * "Rsa" requires one of [RsaDecryptionRaw, RsaDecryptionPkcs1, RsaDecryptionOaepMd5, RsaDecryptionOaepSha1, RsaDecryptionOaepSha224, RsaDecryptionOaepSha256, RsaDecryptionOaepSha384, RsaDecryptionOaepSha512, RsaSignaturePkcs1, RsaSignaturePssMd5, RsaSignaturePssSha1, RsaSignaturePssSha224, RsaSignaturePssSha256, RsaSignaturePssSha384, RsaSignaturePssSha512] * "Curve25519" requires one of [EdDsaSignature] * "EcP224", "EcP256", "EcP384" and "EcP521" require one of [EcdsaSignature] * "Generic" requires at least one of [AesDecryptionCbc, AesEncryptionCbc]

System-wide users in the "Administrator" role import system-wide keys. Namespaced users in the "Administrator" role import keys in their own namespace.

Note: Although assigning tags to the new key is optional, it is highly recommended as not doing so means that all users in the same scope have access to it!

Requires authentication of a user in the "Administrator" role.

The format of key to import

Keys can be imported in Distinguished Encoding Rules (DER) or Privacy-Enhanced Mail (PEM) format.

One of ["Pem", "Der"].

May also be specified with the NETHSM_KEY_FORMAT environment variable.
An optional unique ID that is assigned to the imported key

If none is provided a generic one is generated for the key.

May also be specified with the NETHSM_KEY_ID environment variable.
An optional list of tags that are assigned to the imported key

Tags on keys are used to grant access to those keys for users that carry the same tags.

May also be specified with the NETHSM_KEY_TAGS environment variable.
The path to a file containing a passphrase for authentication

The passphrase provided in the file must be the one for the user chosen for the command.

This option can be provided multiple times, which is needed for commands that require multiple roles at once. With multiple passphrase files ordering matters, as the files are assigned to the respective user provided by the "--user" option.

May also be specified with the NETHSM_AUTH_PASSPHRASE_FILE environment variable.
The path to a custom configuration file

If specified, the custom configuration file is used instead of the default configuration file location.

May also be specified with the NETHSM_CONFIG environment variable.
A label uniquely identifying a device in the configuration file

Must be provided if more than one device is setup in the configuration file.

May also be specified with the NETHSM_LABEL environment variable.
A user name which is used for a command

Can be provided, if no user name is setup in the configuration file for a device. Must be provided, if several user names of the same target role are setup in the configuration file for a device.

This option can be provided multiple times, which is needed for commands that require multiple roles at once.

May also be specified with the NETHSM_USER environment variable.
Print help (see a summary with '-h')
<KEY_TYPE>
The type of key to import

The key type must match the provided key data and chosen key mechanisms!

One of ["AesDecryptionCbc", "AesEncryptionCbc", "EcdsaSignature", "EdDsaSignature", "RsaDecryptionOaepMd5", "RsaDecryptionOaepSha1", "RsaDecryptionOaepSha224", "RsaDecryptionOaepSha256", "RsaDecryptionOaepSha384", "RsaDecryptionOaepSha512", "RsaDecryptionPkcs1", "RsaDecryptionRaw", "RsaSignaturePkcs1", "RsaSignaturePssMd5", "RsaSignaturePssSha1", "RsaSignaturePssSha224", "RsaSignaturePssSha256", "RsaSignaturePssSha384", "RsaSignaturePssSha512"].

May also be specified with the NETHSM_KEY_TYPE environment variable.
<KEY_DATA>
The path to a PKCS#8 private key in ASN.1 DER-encoded format

The private key data must match the chosen key type.

May also be specified with the NETHSM_KEY_DATA environment variable.
[KEY_MECHANISMS]
The mechanisms provided by the imported key

The key mechanisms must match the chosen key type!

At least one of ["AesDecryptionCbc", "AesEncryptionCbc", "EcdsaSignature", "EdDsaSignature", "RsaDecryptionOaepMd5", "RsaDecryptionOaepSha1", "RsaDecryptionOaepSha224", "RsaDecryptionOaepSha256", "RsaDecryptionOaepSha384", "RsaDecryptionOaepSha512", "RsaDecryptionPkcs1", "RsaDecryptionRaw", "RsaSignaturePkcs1", "RsaSignaturePssMd5", "RsaSignaturePssSha1", "RsaSignaturePssSha224", "RsaSignaturePssSha256", "RsaSignaturePssSha384", "RsaSignaturePssSha512"].

May also be specified with the NETHSM_KEY_MECHANISMS environment variable.
nethsm-key-import