public class SignedMailValidator
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
SignedMailValidator.ValidationResult |
| Constructor and Description |
|---|
SignedMailValidator(javax.mail.internet.MimeMessage message,
java.security.cert.PKIXParameters param)
Validates the signed
MimeMessage message. |
SignedMailValidator(javax.mail.internet.MimeMessage message,
java.security.cert.PKIXParameters param,
java.lang.Class certPathReviewerClass)
Validates the signed
MimeMessage message. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkSignerCert(java.security.cert.X509Certificate cert,
java.util.List errors,
java.util.List notifications) |
static java.security.cert.CertPath |
createCertPath(java.security.cert.X509Certificate signerCert,
java.util.Set trustanchors,
java.util.List certStores) |
static java.lang.Object[] |
createCertPath(java.security.cert.X509Certificate signerCert,
java.util.Set trustAnchors,
java.util.List systemCertStores,
java.util.List userCertStores)
Returns an Object array containing a CertPath and a List of Booleans.
|
java.security.cert.CertStore |
getCertsAndCRLs() |
static java.util.Set |
getEmailAddresses(java.security.cert.X509Certificate cert) |
static java.util.Date |
getSignatureTime(org.bouncycastle.cms.SignerInformation signer) |
org.bouncycastle.cms.SignerInformationStore |
getSignerInformationStore() |
SignedMailValidator.ValidationResult |
getValidationResult(org.bouncycastle.cms.SignerInformation signer) |
protected void |
validateSignatures(org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder signerInfoVerifierBuilder,
java.security.cert.PKIXParameters pkixParam) |
protected void |
validateSignatures(java.security.cert.PKIXParameters pkixParam) |
public SignedMailValidator(javax.mail.internet.MimeMessage message,
java.security.cert.PKIXParameters param)
throws SignedMailValidatorException
MimeMessage message. The PKIXParameters from
param are used for the certificate path validation. The actual
PKIXParameters used for the certificate path validation are a copy of param
with the following changes:param it's also possible to add additional CertStores with intermediate
certificates and/or CRLs which then are also used for the validation.message - the signed MimeMessage.param - the parameters for the certificate path validation.SignedMailValidatorException - if the message is not a signed message or if an
exception occurs reading the message.public SignedMailValidator(javax.mail.internet.MimeMessage message,
java.security.cert.PKIXParameters param,
java.lang.Class certPathReviewerClass)
throws SignedMailValidatorException
MimeMessage message. The PKIXParameters from
param are used for the certificate path validation. The actual
PKIXParameters used for the certificate path validation are a copy of param
with the following changes:param it's also possible to add additional CertStores with intermediate
certificates and/or CRLs which then are also used for the validation.message - the signed MimeMessage.param - the parameters for the certificate path validation.certPathReviewerClass - a subclass of PKIXCertPathReviewer. The SignedMailValidator
uses objects of this type for the cert path vailidation. The class must have an empty
constructor.SignedMailValidatorException - if the message is not a signed message or if an exception
occurs reading the message.java.lang.IllegalArgumentException - if the certPathReviewerClass is not a subclass of
PKIXCertPathReviewer or objects of certPathReviewerClass can not be instantiated.protected void validateSignatures(java.security.cert.PKIXParameters pkixParam)
protected void validateSignatures(org.bouncycastle.cms.jcajce.JcaSimpleSignerInfoVerifierBuilder signerInfoVerifierBuilder,
java.security.cert.PKIXParameters pkixParam)
public static java.util.Set getEmailAddresses(java.security.cert.X509Certificate cert)
throws java.io.IOException,
java.security.cert.CertificateEncodingException
java.io.IOExceptionjava.security.cert.CertificateEncodingExceptionprotected void checkSignerCert(java.security.cert.X509Certificate cert,
java.util.List errors,
java.util.List notifications)
public static java.util.Date getSignatureTime(org.bouncycastle.cms.SignerInformation signer)
public static java.security.cert.CertPath createCertPath(java.security.cert.X509Certificate signerCert,
java.util.Set trustanchors,
java.util.List certStores)
throws java.security.GeneralSecurityException
signerCert - the end of the pathtrustanchors - trust anchors for the pathcertStores - java.security.GeneralSecurityExceptionpublic static java.lang.Object[] createCertPath(java.security.cert.X509Certificate signerCert,
java.util.Set trustAnchors,
java.util.List systemCertStores,
java.util.List userCertStores)
throws java.security.GeneralSecurityException
true if the corresponding certificate in the CertPath was taken from the user
provided CertStores.signerCert - the end of the pathtrustAnchors - trust anchors for the pathsystemCertStores - list of CertStore provided by the systemuserCertStores - list of CertStore provided by the userjava.security.GeneralSecurityExceptionpublic java.security.cert.CertStore getCertsAndCRLs()
public org.bouncycastle.cms.SignerInformationStore getSignerInformationStore()
public SignedMailValidator.ValidationResult getValidationResult(org.bouncycastle.cms.SignerInformation signer) throws SignedMailValidatorException
SignedMailValidatorException