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

nethsm-key-public-key - Get the public key for a key

nethsm key public-key [-f|--force] [-o|--output] [-a|--auth-passphrase-file] [-c|--config] [-l|--label] [-u|--user] [-h|--help] <KEY_ID>

Get the public key for a key

The public key is returned as X.509 public key certificate in Privacy-enhanced Electronic Mail (PEM) format. If no specific output file is chosen, the public key is emitted on stdout.

Note: Keys of type "Generic" do not have a public key and this command fails for them!

System-wide users in the "Administrator" or "Operator" role can only get the public key for system-wide keys. Namespaced users in the "Administrator" or "Operator" role can only get the public key for keys in their own namespace.

Requires authentication of a user in the "Administrator" or "Operator" role (with access to the key - see "nethsm key tag" and "nethsm user tag").

Write to output file even if it exists already
May also be specified with the NETHSM_FORCE environment variable.
The optional path to a specific output file
May also be specified with the NETHSM_KEY_PUBKEY_OUTPUT_FILE 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_ID>
The ID of the key to get the public key for
May also be specified with the NETHSM_KEY_ID environment variable.
nethsm-key-public-key