TPM.Crypto (tpm v0.2.0)
Interface with OTP crypto and X509.
Summary
Functions
Create a certificate signing request for a device.
Returns an OTP crypto engine for tpm2tss.
Returns an OTP crypto engine_key_ref (privkey).
Returns an OTP rsa_public public key based on an OTP engine_key_ref private key.
Types
Link to this type
engine_key_ref()
@type engine_key_ref() :: term()
Link to this type
rsa_public_key()
@type rsa_public_key() :: term()
Link to this type
x509_csr()
@type x509_csr() :: term()
Functions
Link to this function
csr(privkey, serial_number, organization)
@spec csr( privkey :: engine_key_ref(), serial_number :: String.t(), organization :: String.t() ) :: x509_csr()
Create a certificate signing request for a device.
Args
privkey
- OTPengine_key_ref
private key reference.organization
- Organization (company) name to list in the certificate.serial_number
- Device serial number or unique identifier.
Link to this function
engine()
Returns an OTP crypto engine for tpm2tss.
Link to this function
privkey(path)
@spec privkey(path :: String.t()) :: {:ok, privkey :: engine_key_ref()} | {:error, reason :: term()}
Returns an OTP crypto engine_key_ref (privkey).
Args
path
- File path of the TPM private key in PEM format.
Link to this function
pubkey(privkey)
@spec pubkey(privkey :: engine_key_ref()) :: rsa_public_key()
Returns an OTP rsa_public public key based on an OTP engine_key_ref private key.
Args
privkey
- OTPengine_key_ref
private key reference.