Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

  • --debug

    Set the logging verbosity level to 'debug'.

  • --log-format format

    Set the format of log output; one of raw, internal-json, bar or bar-with-logs.

  • --print-build-logs / -L

    Print full build logs on standard error.

  • --quiet

    Decrease the logging verbosity level.

  • --verbose / -v

    Increase the logging verbosity level.

Miscellaneous global options

  • --help

    Show usage information.

  • --offline

    Disable substituters and consider all previously downloaded files up-to-date.

  • --option name value

    Set the Nix configuration setting name to value (overriding nix.conf).

  • --refresh

    Consider all previously downloaded files out-of-date.

  • --version

    Show version information.

Note

See man nix.conf for overriding configuration settings with command line flags.