Module org.shredzone.acme4j.smime
Package org.shredzone.acme4j.smime.email
Class EmailProcessor.Builder
java.lang.Object
org.shredzone.acme4j.smime.email.EmailProcessor.Builder
- Enclosing class:
- EmailProcessor
A builder for
EmailProcessor
.
Use EmailProcessor.builder()
to generate an instance.
- Since:
- 2.16
-
Method Summary
Modifier and TypeMethodDescriptionbuild
(jakarta.mail.Message message) Builds anEmailProcessor
for the givenMessage
using the current configuration.caCerts()
Uses the standard cacerts truststore for signature verification.certificate
(X509Certificate certificate) Uses the given certificate for signature verification.mailSession
(jakarta.mail.Session session) Uses the given mailSession
for accessing the signed message body.pkixParameters
(PKIXParameters param) Uses the givenPKIXParameters
.relaxed()
Performs relaxed checks.Skips signature and header verification.strict()
Performs strict checks.trustStore
(KeyStore trustStore) Uses the given truststore for signature verification.
-
Method Details
-
skipVerification
Skips signature and header verification. Use only if the message has already been verified in a previous stage (e.g. by the MTA) or for testing purposes. -
caCerts
Uses the standard cacerts truststore for signature verification. This is the default. -
trustStore
Uses the given truststore for signature verification.This is for self-signed certificates. No revocation checks will take place.
- Parameters:
trustStore
-KeyStore
of the truststore to be used.
-
certificate
Uses the given certificate for signature verification.This is for self-signed certificates. No revocation checks will take place.
- Parameters:
certificate
-X509Certificate
of the CA
-
pkixParameters
Uses the givenPKIXParameters
.- Parameters:
param
-PKIXParameters
to be used for signature verification.
-
mailSession
Uses the given mailSession
for accessing the signed message body. A simple default session is used otherwise, which is usually sufficient.- Parameters:
session
-Session
to be used for accessing the message body.
-
strict
Performs strict checks. Secured headers must exactly match their unsecured counterparts. This is the default. -
relaxed
Performs relaxed checks. Secured headers might differ in whitespaces or case of the field names. Use this if your MTA has mangled the envelope header. -
build
Builds anEmailProcessor
for the givenMessage
using the current configuration.- Parameters:
message
-Message
to create anEmailProcessor
for.- Returns:
- The generated
EmailProcessor
- Throws:
AcmeInvalidMessageException
- if the message fails to be verified. If this exception is thrown, the message MUST be rejected, and MUST NOT be used for certification.
-