View Source Orbit.ClientCertificate (Orbit v0.3.0)

Commonly-used fields from the TLS client certificate.

The original :OTPCertificate record is available in the otp_certificate field. The X509 library is included and can be used to extract additional values from the otp_certificate.

Fields

  • common_name - the common name (CN) string
  • fingerprints - a map of binary fingerprints for various hash algorithms
    • :sha for SHA-1
    • :sha256 for SHA-256
  • not_valid_after - the UTC DateTime at the end of validity
  • not_valid_before - the UTC DateTime at the beginning of validity
  • otp_certificate - the underlying :OTPCertificate record
  • self_signed? - if the certificate has been self-signed (issuer is the same as the subject)
  • serial_number - the serial number integer

Summary

Functions

Returns a new %ClientCertificate{} from a DER-encoded binary.

Types

@type t() :: %Orbit.ClientCertificate{
  common_name: String.t(),
  fingerprints: %{sha: binary(), sha256: binary()},
  not_valid_after: DateTime.t(),
  not_valid_before: DateTime.t(),
  otp_certificate: X509.Certificate.t(),
  self_signed?: boolean(),
  serial_number: non_neg_integer()
}

Functions

@spec from_der(binary()) :: {:ok, t()} | {:error, :malformed}

Returns a new %ClientCertificate{} from a DER-encoded binary.