ExAcme.RevocationBuilder (ExAcme v0.5.1)
View SourceProvides functionality to build ACME certificate revocation requests.
Use this module to construct a revocation request by supplying the certificate in one of several formats
(X509.Certificate
struct, DER binary, or PEM string) and an optional revocation reason.
Summary
Functions
Sets the certificate for revocation using an X509 certificate struct.
Sets the certificate for revocation using a DER-encoded binary.
Sets the certificate for revocation using a PEM-encoded string.
Creates a new revocation builder.
Sets the revocation reason.
Converts the revocation builder to a map.
Types
Functions
@spec certificate(t(), X509.Certificate.t()) :: t()
Sets the certificate for revocation using an X509 certificate struct.
Parameters
revocation
: The current revocation builder.certificate
: AnX509.Certificate
struct representing the certificate to revoke.
Returns
- An updated
ExAcme.RevocationBuilder
struct with the certificate set.
Sets the certificate for revocation using a DER-encoded binary.
Parameters
revocation
: The current revocation builder.der
: A binary containing the DER-encoded certificate.
Returns
- An updated
ExAcme.RevocationBuilder
struct with the certificate set.
Sets the certificate for revocation using a PEM-encoded string.
Parameters
revocation
: The current revocation builder.pem
: A string containing the PEM-encoded certificate.
Returns
{:ok, revocation}
if successful and the PEM certificate is valid.{:error, reason}
if the PEM certificate is invalid.
@spec new_revocation() :: t()
Creates a new revocation builder.
Returns
- A new
ExAcme.RevocationBuilder
struct with no certificate or reason set.
Sets the revocation reason.
Accepts either a named reason or a numeric reason code as defined in RFC 5280.
Parameters
revocation
: The current revocation builder.reason
: An atom representing the reason (:unspecified
,:key_compromise
,:affiliation_changed
,:superseded
, or:cessation_of_operation
) or an integer code.
Returns
- An updated
ExAcme.RevocationBuilder
struct with the reason set.
Converts the revocation builder to a map.
Removes any keys with nil values and converts all keys to camelCase for API compatibility.
Parameters
revocation
: The revocation builder struct.
Returns
- A map representing the revocation request.