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()

:crypto.engine_key_ref

Link to this type

rsa_public_key()

@type rsa_public_key() :: term()

:crypto.rsa_public_key

@type x509_csr() :: term()

X509.CSR.t

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 - OTP engine_key_ref private key reference.
  • organization - Organization (company) name to list in the certificate.
  • serial_number - Device serial number or unique identifier.
@spec engine() :: {:ok, engine :: reference()} | {:error, reason :: term()}

Returns an OTP crypto engine for tpm2tss.

@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 - OTP engine_key_ref private key reference.