Class DigitalSignatureValidationResult
-
- All Implemented Interfaces:
-
android.os.Parcelable
public final class DigitalSignatureValidationResult implements Parcelable
Detailed status about validity of a DigitalSignatureInfo. For overall status of the validity of the signature, see return status of getValidationStatus method.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enum
DigitalSignatureValidationResult.ValidationProblem
Problems that prevented proper validation of a signature.
public enum
DigitalSignatureValidationResult.DocumentIntegrityStatus
Status of the signed document. The default integrity of a signed and non-modified document is OK.
public enum
DigitalSignatureValidationResult.CertificateStatus
Status of the certificate that was used for signing the document. The default status of a valid CA-issued certificate is OK.
-
Field Summary
Fields Modifier and Type Field Description public final static Parcelable.Creator<DigitalSignatureValidationResult>
CREATOR
public final List<DigitalSignatureValidationResult.ValidationProblem>
problems
public final DigitalSignatureValidationResult.DocumentIntegrityStatus
documentIntegrityStatus
public final DigitalSignatureValidationResult.CertificateStatus
certificateChainValidationStatus
public final String
certificateChainValidationErrorMessage
public String
signatureType
public String
padesSignatureLevel
public final X509CertificateData
signingCertificate
public final TimestampInformation
timestampStatus
public final String
signatureAlgorithm
public final String
hashAlgorithm
-
Method Summary
-
-
Method Detail
-
getProblems
@NonNull() List<DigitalSignatureValidationResult.ValidationProblem> getProblems()
Returns of list of problems when validation status is either WARNING or ERROR. If the list contains CERTIFICATE_CHAIN_FAILURE, more information can be retrieved with getCertificateChainValidationStatus and getCertificateChainValidationErrorMessage. If the list contains DOCUMENT_INTEGRITY_FAILURE, more information can be retrieved with getDocumentIntegrityStatus.
- Returns:
List of problems if validation failed or empty list if the signature is valid.
-
getDocumentIntegrityStatus
@NonNull() DigitalSignatureValidationResult.DocumentIntegrityStatus getDocumentIntegrityStatus()
Returns status of document integrity. If the document content has been changed or tampered with, this will return an error status. Note that this does not check if there was any content or annotations added to the document - use wasDocumentModified check for that.
- Returns:
DocumentIntegrityStatus enum describing the status of document integrity.
-
getCertificateChainValidationStatus
@Nullable() DigitalSignatureValidationResult.CertificateStatus getCertificateChainValidationStatus()
Returns status of certificate verification. If this is not OK or OK_BUT_SELF_SIGNED, more information can be retrieved with getCertificateChainValidationErrorMessage.
- Returns:
CertificateStatus describing the status of certificate validity.
-
getCertificateChainValidationErrorMessage
@Nullable() String getCertificateChainValidationErrorMessage()
Returns an English string describing the reason for certificate validation failure.
- Returns:
string describing certificate validation error or
null
if it fails.
-
getSignatureType
@NonNull() String getSignatureType()
-
getPadesSignatureLevel
@NonNull() String getPadesSignatureLevel()
-
getSigningCertificate
@Nullable() X509CertificateData getSigningCertificate()
-
getTimestampStatus
@Nullable() TimestampInformation getTimestampStatus()
-
getSignatureAlgorithm
@Nullable() String getSignatureAlgorithm()
-
getHashAlgorithm
@Nullable() String getHashAlgorithm()
-
getValidationStatus
@NonNull() ValidationStatus getValidationStatus()
Returns overall validity status of the digital signature. This reflects state of all other statuses and should be checked first.
-
wasDocumentModified
boolean wasDocumentModified()
Returns if there was any appending done to the document after this signature. If the content of signed area has changed, getDocumentIntegrityStatus will report an integrity failure. If there was any addition (new annotation etc.) added to the document, getDocumentIntegrityStatus will report OK and this will return
true
.- Returns:
true
if there was anything appended after the document was signed,false
otherwise.
-
describeContents
int describeContents()
-
writeToParcel
void writeToParcel(Parcel dest, int flags)
-
-
-
-