|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object iaik.smime.ess.utils.SignerInfoVerificationResult
public class SignerInfoVerificationResult
Result of the signature verification of a CMS SignerInfo.
When using a MLA
agent to resolve
some S/MIME message into its layers
, the signatures of all SignerInfos
of any included signed
layer are verified. If you decide not to stop
the layer resolving process if an invalid signature is
detected, you later may query
the signed
layer for the signature verification results, e.g.:
MLA mla = ...; mla.setStopOnInvalidSignature(false); // the message to process: MimeMessage msg = ...; // resolve the message into its layers: ESSLayers layers = mla.resolve(msg); // query for signed layers ESSLayer[] layers = layers.getAllLayers(); for (int i = 0; i < layers.length; i++) { if (layers[i].getType() == ESSLayer.SIGNED_DATA) { SignedESSLayer signedLayer = (SignedESSLayer)layers[i]; // get the SignerInfo verification results: SignerInfoVerificationResult[] results = signedLayer.getSignerInfoVerificationResults(); ... } }A SignerInfoVerificationResult may have one of three verification states:
signature not verified
:
Indicates that the signature yet has not been verified; or that it
has not been possible to verify the signature for some reason (e.g.
the signer certificate was not available)
signature valid
:
Indicates that the signature has been verified and is valid.
signature invalid
:
Indicates that the signature has been verified and is invalid.
SIGNATURE_VALID
,
method getSignatureException
may be used to get
information about the reason of the verification failure:
int verificationStatus = signerInfoVerificationResult.getVerificationStatus(); if (verificationStatus != SignerInfoVerificationResult.SIGNATURE_VALID) { CMSSignatureException ex = signerInfoVerificationResult.getSignatureException(); ... }
MLA
,
ESSLayer
,
ESSLayers
,
SignedESSLayer
,
SignerInfo
,
CMSSignatureException
Field Summary | |
---|---|
static int |
SIGNATURE_INVALID
Signature verification status code "signature invalid" (integer 2). |
static int |
SIGNATURE_NOT_VERIFIED
Signature verification status code "signature not verified" (integer 0, initial state). |
static int |
SIGNATURE_VALID
Signature verification status code "signature valid" (integer 1). |
Constructor Summary | |
---|---|
SignerInfoVerificationResult(CertificateIdentifier signerID)
Creates a SignerInfoVerificationResult for the given signer id with verification status code SIGNATURE_NOT_VERIFIED (0). |
|
SignerInfoVerificationResult(int verificationStatus,
CertificateIdentifier signerID)
Creates a new SignerInfoVerificationResult for the given signer id with the given verification status code. |
Method Summary | |
---|---|
CMSSignatureException |
getSignatureException()
Gets the exception that has caused a signature verification failure |
CertificateIdentifier |
getSignerID()
Returns the id of the SignerInfo to which this SignerInfoVerifcationResult belongs to. |
int |
getVerificationStatus()
Returns the verification status. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int SIGNATURE_NOT_VERIFIED
public static final int SIGNATURE_VALID
public static final int SIGNATURE_INVALID
Constructor Detail |
---|
public SignerInfoVerificationResult(CertificateIdentifier signerID)
SIGNATURE_NOT_VERIFIED
(0).
signerID
- the id of the SignerInfo to which this SignerInfoVerificationResult belongs topublic SignerInfoVerificationResult(int verificationStatus, CertificateIdentifier signerID)
verificationStatus
- the verification status code, either
SIGNATURE_NOT_VERIFIED
(0)
SIGNATURE_VALID
(1)
SIGNATURE_INVALID
(2)
signerID
- the id of the SignerInfo to which this SignerInfoVerificationResult belongs toMethod Detail |
---|
public int getVerificationStatus()
SIGNATURE_NOT_VERIFIED
(0)
SIGNATURE_VALID
(1)
SIGNATURE_INVALID
(2)
public CertificateIdentifier getSignerID()
SIGNATURE_INVALID
(2)).
public CMSSignatureException getSignatureException()
null
if the signature of this signer is valid verification status code
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |