nerves_key_pkcs11 v0.2.0 NervesKey.PKCS11
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.
Link to this section Summary
Types
The device/signer certificate pair to use
I2C bus
Option for which NervesKey and certificate to use
Link to this section Types
Link to this type
certificate_pair()
certificate_pair()
certificate_pair() :: :primary | :aux
certificate_pair() :: :primary | :aux
The device/signer certificate pair to use
Link to this type
i2c_bus()
i2c_bus()
i2c_bus() :: 0..15
i2c_bus() :: 0..15
I2C bus
Link to this type
option()
option()
option() :: {:i2c, i2c_bus()} | {:certificate, certificate_pair()}
option() :: {:i2c, i2c_bus()} | {:certificate, certificate_pair()}
Option for which NervesKey and certificate to use.
:i2c
- which I2C bus:certificate
- which NervesKey certificate to use (:primary
or:aux
)
Link to this section Functions
Link to this function
load_engine()
load_engine()
load_engine() :: {:ok, :crypto.engine_ref()} | {:error, any()}
load_engine() :: {:ok, :crypto.engine_ref()} | {:error, any()}
Load the OpenSSL engine
Link to this function
private_key(engine, location)
private_key(engine, location)
private_key(:crypto.engine_ref(), [option()] | {:i2c, i2c_bus()}) :: map()
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
)):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.