Name
nix key convert-public-to-pem - convert a public key read from standard input to PEM SubjectPublicKeyInfo format
Synopsis
nix key convert-public-to-pem [option...]
Examples
-
Convert a Nix public key to PEM:
# nix key convert-secret-to-public < secret-key \ | nix key convert-public-to-pem -----BEGIN PUBLIC KEY----- … -----END PUBLIC KEY----- -
Convert a public key to PEM and decode it using OpenSSL:
# nix key convert-public-to-pem < public-key \ | openssl pkey -pubin -text -noout ML-DSA-87 Public-Key: pub: …
Description
This command reads a Nix public verification key (as produced by nix key convert-secret-to-public) from standard input and writes the corresponding PEM SubjectPublicKeyInfo to standard output. The key name is not included in the PEM output.
Options
Logging-related options
-
Set the logging verbosity level to 'debug'.
-
--log-formatformatSet the format of log output; one of
raw,internal-json,barorbar-with-logs. -
--print-build-logs/-LPrint full build logs on standard error.
-
Decrease the logging verbosity level.
-
--verbose/-vIncrease the logging verbosity level.
Miscellaneous global options
-
Show usage information.
-
Disable substituters and consider all previously downloaded files up-to-date.
-
--optionname valueSet the Nix configuration setting name to value (overriding
nix.conf). -
Consider all previously downloaded files out-of-date.
-
Show version information.
Note
See
man nix.conffor overriding configuration settings with command line flags.