public class

SignedMailValidator

extends Object
java.lang.Object
   ↳ org.bouncycastle.mail.smime.validator.SignedMailValidator

Summary

Nested Classes
class SignedMailValidator.ValidationResult  
Public Constructors
SignedMailValidator(MimeMessage message, PKIXParameters param)
Validates the signed MimeMessage message.
SignedMailValidator(MimeMessage message, PKIXParameters param, Class certPathReviewerClass)
Validates the signed MimeMessage message.
Public Methods
static Object[] createCertPath(X509Certificate signerCert, Set trustanchors, List systemCertStores, List userCertStores)
Returns an Object array containing a CertPath and a List of Booleans.
static CertPath createCertPath(X509Certificate signerCert, Set trustanchors, List certStores)
CertStore getCertsAndCRLs()
static Set getEmailAddresses(X509Certificate cert)
static Date getSignatureTime(SignerInformation signer)
SignerInformationStore getSignerInformationStore()
SignedMailValidator.ValidationResult getValidationResult(SignerInformation signer)
Protected Methods
void checkSignerCert(X509Certificate cert, List errors, List notifications)
void validateSignatures(PKIXParameters pkixParam)
[Expand]
Inherited Methods
From class java.lang.Object

Public Constructors

public SignedMailValidator (MimeMessage message, PKIXParameters param)

Validates the signed MimeMessage message. The PKIXParameters from param are used for the certificate path validation. The actual PKIXParameters used for the certificate path validation is a copy of param with the followin changes:
- The validation date is changed to the signature time
- A CertStore with certificates and crls from the mail message is added to the CertStores.

In param it's also possible to add additional CertStores with intermediate Certificates and/or CRLs which then are also used for the validation.

Parameters
message the signed MimeMessage
param the parameters for the certificate path validation
Throws
SignedMailValidatorException if the message is no signed message or if an exception occurs reading the message

public SignedMailValidator (MimeMessage message, PKIXParameters param, Class certPathReviewerClass)

Validates the signed MimeMessage message. The PKIXParameters from param are used for the certificate path validation. The actual PKIXParameters used for the certificate path validation is a copy of param with the followin changes:
- The validation date is changed to the signature time
- A CertStore with certificates and crls from the mail message is added to the CertStores.

In param it's also possible to add additional CertStores with intermediate Certificates and/or CRLs which then are also used for the validation.

Parameters
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.
Throws
SignedMailValidatorException if the message is no signed message or if an exception occurs reading the message
IllegalArgumentException if the certPathReviewerClass is not a subclass of PKIXCertPathReviewer or objects of certPathReviewerClass can not be instantiated

Public Methods

public static Object[] createCertPath (X509Certificate signerCert, Set trustanchors, List systemCertStores, List userCertStores)

Returns an Object array containing a CertPath and a List of Booleans. The list contains the value true if the corresponding certificate in the CertPath was taken from the user provided CertStores.

Parameters
signerCert the end of the path
trustanchors trust anchors for the path
systemCertStores list of CertStore provided by the system
userCertStores list of CertStore provided by the user
Returns
  • a CertPath and a List of booleans.

public static CertPath createCertPath (X509Certificate signerCert, Set trustanchors, List certStores)

Parameters
signerCert the end of the path
trustanchors trust anchors for the path
Returns
  • the resulting certificate path.

public CertStore getCertsAndCRLs ()

public static Set getEmailAddresses (X509Certificate cert)

public static Date getSignatureTime (SignerInformation signer)

public SignerInformationStore getSignerInformationStore ()

Protected Methods

protected void checkSignerCert (X509Certificate cert, List errors, List notifications)

protected void validateSignatures (PKIXParameters pkixParam)