public class SignedMailValidator extends Object
Modifier and Type | Class and Description |
---|---|
class |
SignedMailValidator.ValidationResult |
Constructor and Description |
---|
SignedMailValidator(javax.mail.internet.MimeMessage message,
PKIXParameters param)
Validates the signed
MimeMessage message. |
SignedMailValidator(javax.mail.internet.MimeMessage message,
PKIXParameters param,
Class certPathReviewerClass)
Validates the signed
MimeMessage message. |
Modifier and Type | Method and Description |
---|---|
static CertPath |
createCertPath(X509Certificate signerCert,
Set trustanchors,
List certStores) |
static Object[] |
createCertPath(X509Certificate signerCert,
Set trustanchors,
List systemCertStores,
List userCertStores)
Returns an Object array containing a CertPath and a List of Booleans.
|
CertStore |
getCertsAndCRLs() |
static Set |
getEmailAddresses(X509Certificate cert) |
static Date |
getSignatureTime(SignerInformation signer) |
SignerInformationStore |
getSignerInformationStore() |
SignedMailValidator.ValidationResult |
getValidationResult(SignerInformation signer) |
protected void |
checkSignerCert(X509Certificate cert,
List errors,
List notifications) |
protected void |
validateSignatures(PKIXParameters pkixParam) |
public SignedMailValidator(javax.mail.internet.MimeMessage message, 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 is a copy of param with the followin 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 MimeMessageparam
- the parameters for the certificate path validationSignedMailValidatorException
- if the message is no signed message or if an exception occurs
reading the messagepublic SignedMailValidator(javax.mail.internet.MimeMessage message, PKIXParameters param, 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 is a copy of param with the followin 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 MimeMessageparam
- the parameters for the certificate path validationcertPathReviewerClass
- 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 no signed message or if an exception occurs
reading the messageIllegalArgumentException
- if the certPathReviewerClass is not a
subclass of PKIXCertPathReviewer
or objects of
certPathReviewerClass can not be instantiatedprotected void validateSignatures(PKIXParameters pkixParam)
public static Set getEmailAddresses(X509Certificate cert) throws IOException, CertificateEncodingException
protected void checkSignerCert(X509Certificate cert, List errors, List notifications)
public static Date getSignatureTime(SignerInformation signer)
public static CertPath createCertPath(X509Certificate signerCert, Set trustanchors, List certStores) throws GeneralSecurityException
signerCert
- the end of the pathtrustanchors
- trust anchors for the pathcertStores
- GeneralSecurityException
public static Object[] createCertPath(X509Certificate signerCert, Set trustanchors, List systemCertStores, List userCertStores) throws 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 userGeneralSecurityException
public CertStore getCertsAndCRLs()
public SignerInformationStore getSignerInformationStore()
public SignedMailValidator.ValidationResult getValidationResult(SignerInformation signer) throws SignedMailValidatorException
SignedMailValidatorException
Copyright © 2015. All rights reserved.