View Source NervesKey.PKCS11 (nerves_key_pkcs11 v1.2.0)
This module contains helper methods for loading and using the PKCS #11 module for NervesKey in Elixir. You don't need to use these methods to use the shared library.
Summary
Types
The device/signer certificate pair to use
I2C bus
Option for which NervesKey and certificate to use.
Types
@type certificate_pair() :: :primary | :aux
The device/signer certificate pair to use
@type i2c_bus() :: 0..31
I2C bus
@type option() :: {:i2c, i2c_bus()} | {:certificate, certificate_pair()} | {:type, :nerves_key | :trust_and_go}
Option for which NervesKey and certificate to use.
:i2c
- which I2C bus:certificate
- which NervesKey certificate to use (:primary
or:aux
):type
- if using pre-provisioned ATECC608B Trust and Go parts, specify:trust_and_go
Functions
@spec load_engine() :: {:ok, :crypto.engine_ref()} | {:error, any()}
Load the OpenSSL engine
@spec private_key(:crypto.engine_ref(), [option()] | {:i2c, i2c_bus()}) :: map()
Return the key map for passing a private key to ssl_opts.
This method creates the key map that the :crypto
library can
use to properly route private key operations to the PKCS #11
shared library.
Options:
:i2c
- which I2C bus (defaults to I2C bus 0 (/dev/i2c-0
)):type
- :nerves_key or :trust_and_go (defaults to :nerves_key):certificate
- which certificate on the NervesKey to use (defaults to:primary
)
Passing {:i2c, 1}
is still supported, but should be updated to use keyword
list form for the options.