Skip to main content

Python client for Nitrokey devices

Project description

pynitrokey

A command line interface for the Nitrokey FIDO2, Nitrokey Start, Nitrokey 3 and NetHSM.

Quickstart

$ pipx install pynitrokey
$ nitropy --help

Documentation

The user documentation for the nitropy CLI is available on docs.nitrokey.com. See also the product documentation for more information on the available commands:

Switching Nitrokey Start identities

Alternative MI switching method

pynitrokey installation is not always possible, hence describing below alternative method to change the Identity on the Nitrokey Start. It suffices to have any CCID application installed, and send the following APDU 00 85 00 {ID} (hex), where ID is in range [0;2]. After receiving this command Nitrokey Start will reboot with the selected identity.

Here is how to do it using GnuPG:

# Setting ID to 2
$ gpg-connect-agent --hex "scd apdu  00 85 00 02" /bye
ERR 65539 Unknown version in packet <Unspecified source>

# Alternative error messsage
ERR 65572 Bad certificate <Unspecified source>

The error message here is expected due to immediate reboot of the device, and with losing the connection.

When the ID change is attempted to be done immediately, the following response could be received:

ERR 100663406 Card removed <SCD>

To restore the communication, either kill the gpg-agent or run gpg --card-status again.

Tip: alternative gpg-connect-agent reloadagent /bye is not sufficient.

Compatibility

nitropy requires Python 3.10 or later.

Development

Information for developers and contributors can be found in the Developer Guide.

Contributors

pynitrokey development has been supported by these contributors:

Maintainers

Current maintainers can be found in MAINTAINERS.md file.

License

pynitrokey is licensed under either of

at your option.

pynitrokey also contains code originating from these projects:

For more information, see the SDPX license headers in each file.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pynitrokey-0.11.4.tar.gz (151.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pynitrokey-0.11.4-py3-none-any.whl (187.5 kB view details)

Uploaded Python 3

File details

Details for the file pynitrokey-0.11.4.tar.gz.

File metadata

  • Download URL: pynitrokey-0.11.4.tar.gz
  • Upload date:
  • Size: 151.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pynitrokey-0.11.4.tar.gz
Algorithm Hash digest
SHA256 312a96818bae53bbae61ab314d32d16ebac0590030138a909446481e2601ffbf
MD5 b5aca54d96c276561d357a25ebfa8fa9
BLAKE2b-256 5ece7f867f81565fbb43587df22fde5c8f3d1dc90178e10c6d9fdb8caf13ae11

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynitrokey-0.11.4.tar.gz:

Publisher: cd-pypi.yaml on Nitrokey/pynitrokey

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pynitrokey-0.11.4-py3-none-any.whl.

File metadata

  • Download URL: pynitrokey-0.11.4-py3-none-any.whl
  • Upload date:
  • Size: 187.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pynitrokey-0.11.4-py3-none-any.whl
Algorithm Hash digest
SHA256 9d7b646b95b0b43aee63614daff8d222127051b7c92515cf59bd3daf7da75eb4
MD5 7612f8319311e6446170d52ddf7722bb
BLAKE2b-256 209a15623f458bae0f57b06b6837d2f4df3748f7979f9a6d87495e833a3f224a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pynitrokey-0.11.4-py3-none-any.whl:

Publisher: cd-pypi.yaml on Nitrokey/pynitrokey

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page