X509 v0.1.0 X509.CSR View Source

Implements PKCS#10 Certificate Signing Requests (CSRs), formally known by their ASN.1 type CertificationRequest.

For conversion to and from PEM or DER format, use the generic functions in the X509 module.

Link to this section Summary

Types

t()

:CertificationRequest record , as used in Erlang’s :public_key module

Functions

Returns a :CertificationRequest record for the given key pair and subject

Extracts the public key from the CSR

Returns the Subject field of the CSR

Verifies whether a CSR has a valid signature

Link to this section Types

:CertificationRequest record , as used in Erlang’s :public_key module

Link to this section Functions

Link to this function new(private_key, subject, opts \\ []) View Source

Returns a :CertificationRequest record for the given key pair and subject.

Supports RSA and EC private keys. The public key is extracted from the private key and encoded, together with the subject, in the CSR. The CSR is then signed with the private key, using a configurable hash algorithm.

The default hash algorithm is :sha256. An alternative algorithm can be specified using the :hash option. Possible values include :sha224, :sha256, :sha384, :sha512.

Older hash algorithms, supported for compatibility with older software only, include :md5 (RSA only) and :sha. The use of these algorithms is discouraged.

Link to this function public_key(arg) View Source
public_key(t()) :: X509.PublicKey.t()

Extracts the public key from the CSR.

Returns the Subject field of the CSR.

Verifies whether a CSR has a valid signature.