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 anEmailProcessorfor the givenMessageusing 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 mailSessionfor 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-KeyStoreof 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-X509Certificateof the CA
-
pkixParameters
Uses the givenPKIXParameters.- Parameters:
param-PKIXParametersto be used for signature verification.
-
mailSession
Uses the given mailSessionfor accessing the signed message body. A simple default session is used otherwise, which is usually sufficient.- Parameters:
session-Sessionto 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 anEmailProcessorfor the givenMessageusing the current configuration.- Parameters:
message-Messageto create anEmailProcessorfor.- 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.
-