public class TSLValidatorResult extends java.lang.Object implements ITSLValidatorResult
Class that represents a TSL validation result.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
MAPPING_CLASSIFICATION_ESEAL, MAPPING_CLASSIFICATION_ESIG, MAPPING_CLASSIFICATION_LEGALPERSON, MAPPING_CLASSIFICATION_NATURAL_PERSON, MAPPING_CLASSIFICATION_OTHER_UNKNOWN, MAPPING_CLASSIFICATION_TSA, MAPPING_CLASSIFICATION_WSA, MAPPING_QSCD_ASINCERT, MAPPING_QSCD_NO, MAPPING_QSCD_UNKNOWN, MAPPING_QSCD_YES, MAPPING_QSCD_YES_MANAGEDONBEHALF, MAPPING_TYPE_NONQUALIFIED, MAPPING_TYPE_QUALIFIED, MAPPING_TYPE_UNKNOWN, RESULT_DETECTED_STATE_CERTCHAIN_NOTVALID, RESULT_DETECTED_STATE_CERTCHAIN_NOTVALID_SERVICESTATUS, RESULT_DETECTED_STATE_REVOKED, RESULT_DETECTED_STATE_REVOKED_SERVICESTATUS, RESULT_DETECTED_STATE_UNKNOWN, RESULT_DETECTED_STATE_VALID, RESULT_NOT_DETECTED| Constructor and Description |
|---|
TSLValidatorResult(java.security.cert.X509Certificate cert,
ITSLObject tslObject)
Constructor method for the class TSLValidatorResult.java.
|
| Modifier and Type | Method and Description |
|---|---|
void |
clearIssuerData()
Removes all the stored data about the issuer of the certificate to validate.
|
java.security.cert.X509Certificate |
getIssuerCert()
Gets the X509 Certificate of the issuer of the certificate to validate (if this has been found).
|
java.security.PublicKey |
getIssuerPublicKey()
Gets the value of the attribute
issuerPublicKey. |
byte[] |
getIssuerSKIbytes()
Gets the value of the attribute
issuerSKIbytes. |
java.lang.String |
getIssuerSubjectName()
Gets the value of the attribute
issuerSubjectName. |
int |
getMappingClassification()
Gets the mapping classification of the validated certificate.
|
int |
getMappingQSCD()
Gets the mapping QSCD of the validated certificate.
|
java.util.Map<java.lang.String,java.lang.String> |
getMappings()
Gets all the mappings information calculated for the validated certificate.
|
int |
getMappingType()
Gets the mapping type of the validated certificate.
|
int |
getResult()
Gets the validation result.
|
java.util.Date |
getRevocationDate()
Gets the revocation date of the certificate validate (if it is revoked).
|
int |
getRevocationReason()
Gets the Revocation Reason for the certificate that has been validated.
|
org.bouncycastle.cert.ocsp.BasicOCSPResp |
getRevocationValueBasicOCSPResp()
Gets the Basic OCSP Response selected how revocation value.
|
java.security.cert.X509CRL |
getRevocationValueCRL()
Gets the CRL selected how revocation value.
|
java.lang.String |
getRevocationValueURL()
Gets the URL from which the revocation value has been obtained.
|
TSLCertificateExtensionAnalyzer |
getTslCertificateExtensionAnalyzer()
Gets the extension analyzer for the certificate to validate.
|
java.lang.String |
getTslCountryRegionCode()
Gets the TSL Country/Region Code.
|
java.lang.String |
getTslEtsiSpecificationAndVersion()
Gets the TSL ETSI TS Specification and Version.
|
java.util.Date |
getTslIssueDate()
Gets the TSL Issue Date.
|
java.util.Date |
getTslNextUpdate()
Gets the TSL Next Update Date.
|
int |
getTslSequenceNumber()
Gets the TSL Sequence Number.
|
TrustServiceProvider |
getTSP()
Gets the TSP which has detected the certificate.
|
java.lang.String |
getTSPName()
Gets the name of the TSP which has detected the certificate.
|
TSPService |
getTSPServiceForDetect()
Gets the TSP Service which has detected the certificate.
|
TSPService |
getTSPServiceForValidate()
Gets the value of the attribute
tspServiceForValidate. |
ServiceHistoryInstance |
getTSPServiceHistoryInformationInstanceForDetect()
Gets the TSP Service History-Information which has detected the certificate.
|
ServiceHistoryInstance |
getTSPServiceHistoryInformationInstanceForValidate()
Gets the TSP Service History-Information which has validate the certificate.
|
java.lang.String |
getTSPServiceHistoryInformationInstanceNameForDetect()
Gets the name of the TSP Service History-Information which has detected the certificate.
|
java.lang.String |
getTSPServiceHistoryInformationInstanceNameForValidate()
Gets the name of the TSP Service History-Information which has validate the certificate.
|
java.lang.String |
getTSPServiceNameForDetect()
Gets the name of the TSP Service which has detected the certificate.
|
java.lang.String |
getTSPServiceNameForValidate()
Gets the name of the TSP Service which has validate the certificate.
|
boolean |
hasBeenDetectedTheCertificate()
Checks if the result is different of
ITSLValidatorResult.RESULT_NOT_DETECTED. |
boolean |
hasBeenDetectedTheCertificateWithUnknownState()
Checks if the result is equal to
ITSLValidatorResult.RESULT_DETECTED_STATE_UNKNOWN. |
boolean |
isEuropean()
Check if the TSL used is from an European member.
|
java.lang.Boolean |
isResultFromDPorAIA()
Checks if the validation result value is obtained from a DP or AIA.
|
java.lang.Boolean |
isResultFromServiceStatus()
Checks if the validation result value is obtained from a TSL-Service status.
|
void |
resetAllData()
Resets all the data except the certificate extension analyzer.
|
void |
setEuropean(boolean isEuropeanParam)
Sets the value of the attribute
isEuropean. |
void |
setIssuerCert(java.security.cert.X509Certificate issuerCertParam)
Sets the value of the attribute
issuerCert. |
void |
setIssuerPublicKey(java.security.PublicKey issuerPublicKeyParam)
Sets the value of the attribute
issuerPublicKey. |
void |
setIssuerSKIbytes(byte[] issuerSKIbytesParam)
Sets the value of the attribute
issuerSKIbytes. |
void |
setIssuerSubjectName(java.lang.String issuerSubjectNameParam)
Sets the value of the attribute
issuerSubjectName. |
void |
setMappingClassification(int mappingClassificationParam)
Sets the value of the attribute
mappingClassification. |
void |
setMappingQSCD(int mappingQSCDParam)
Sets the value of the attribute
mappingQSCD. |
void |
setMappings(java.util.Map<java.lang.String,java.lang.String> mappings)
Sets the mappings calculated for the validated certificate.
|
void |
setMappingType(int mappingTypeParam)
Sets the value of the attribute
mappingType. |
void |
setResult(int resultParam)
Sets the value of the attribute
result. |
void |
setResultFromDPorAIA(java.lang.Boolean isResultFromDPorAIAParam)
Sets the value of the attribute
isResultFromDPorAIA. |
void |
setResultFromServiceStatus(java.lang.Boolean isResultFromServiceStatusParam)
Sets the flag that determines if the result has been obtained from a TSL-Service status.
|
void |
setRevocationDate(java.util.Date revocationDateParam)
Sets the value of the attribute
revocationDate. |
void |
setRevocationReason(int revocationReasonParam)
Sets the value of the attribute
revocationReason. |
void |
setRevocationValueBasicOCSPResp(org.bouncycastle.cert.ocsp.BasicOCSPResp bor)
Sets the selected revocation value of type Basic OCSP Response.
|
void |
setRevocationValueCRL(java.security.cert.X509CRL crl)
Sets the selected revocation value of type CRL.
|
void |
setRevocationValueURL(java.lang.String revValueUrlParam)
Sets the URL from which the revocation value has been obtained.
|
void |
setTSP(TrustServiceProvider tspParam)
Sets the value of the attribute
tsp. |
void |
setTSPName(java.lang.String tspNameParam)
Sets the value of the attribute
tspName. |
void |
setTSPServiceForDetect(TSPService tspServiceForDetectParam)
Sets the value of the attribute
tspServiceForDetect. |
void |
setTSPServiceForValidate(TSPService tspServiceForValidateParam)
Sets the value of the attribute
tspServiceForValidate. |
void |
setTSPServiceHistoryInformationInstanceForDetect(ServiceHistoryInstance tspServiceHistoryInformationInstanceForDetectParam)
Sets the value of the attribute
tspServiceHistoryInformationInstanceForDetect. |
void |
setTspServiceHistoryInformationInstanceForValidate(ServiceHistoryInstance tspServiceHistoryInformationInstanceForValidateParam)
Sets the value of the attribute
tspServiceHistoryInformationInstanceForValidate. |
void |
setTSPServiceHistoryInformationInstanceNameForDetect(java.lang.String tspServiceHistoryInformationInstanceNameForDetectParam)
Sets the value of the attribute
tspServiceHistoryInformationInstanceNameForDetect. |
void |
setTspServiceHistoryInformationInstanceNameForValidate(java.lang.String tspServiceHistoryInformationInstanceNameForValidateParam)
Sets the value of the attribute
tspServiceHistoryInformationInstanceNameForValidate. |
void |
setTSPServiceNameForDetect(java.lang.String tspServiceNameForDetectParam)
Sets the value of the attribute
tspServiceNameForDetect. |
void |
setTSPServiceNameForValidate(java.lang.String tspServiceNameForValidateParam)
Sets the value of the attribute
tspServiceNameForValidate. |
public TSLValidatorResult(java.security.cert.X509Certificate cert,
ITSLObject tslObject)
throws TSLValidationException
cert - X509v3 Certificate to validate.tslObject - Object representation of the TSL that is going to be used in the
validation process.TSLValidationException - In case of some error parsing the extensions
of the input certificate.public java.lang.String getTslCountryRegionCode()
getTslCountryRegionCode in interface ITSLValidatorResultITSLValidatorResult.getTslCountryRegionCode()public int getTslSequenceNumber()
getTslSequenceNumber in interface ITSLValidatorResultITSLValidatorResult.getTslSequenceNumber()public java.lang.String getTslEtsiSpecificationAndVersion()
getTslEtsiSpecificationAndVersion in interface ITSLValidatorResultITSLValidatorResult.getTslEtsiSpecificationAndVersion()public java.util.Date getTslIssueDate()
getTslIssueDate in interface ITSLValidatorResultITSLValidatorResult.getTslIssueDate()public java.util.Date getTslNextUpdate()
getTslNextUpdate in interface ITSLValidatorResultITSLValidatorResult.getTslNextUpdate()public TSLCertificateExtensionAnalyzer getTslCertificateExtensionAnalyzer()
getTslCertificateExtensionAnalyzer in interface ITSLValidatorResultITSLValidatorResult.getTslCertificateExtensionAnalyzer()public int getResult()
ITSLValidatorResult.RESULT_NOT_DETECTEDITSLValidatorResult.RESULT_DETECTED_STATE_UNKNOWNITSLValidatorResult.RESULT_DETECTED_STATE_VALIDITSLValidatorResult.RESULT_DETECTED_STATE_REVOKEDITSLValidatorResult.RESULT_DETECTED_STATE_CERTCHAIN_NOTVALIDITSLValidatorResult.RESULT_DETECTED_STATE_REVOKED_SERVICESTATUSITSLValidatorResult.RESULT_DETECTED_STATE_CERTCHAIN_NOTVALID_SERVICESTATUSgetResult in interface ITSLValidatorResultITSLValidatorResult.getResult()public final void setResult(int resultParam)
result.resultParam - The value for the attribute result.public java.lang.Boolean isResultFromServiceStatus()
isResultFromServiceStatus in interface ITSLValidatorResultnull if the certificate has not been detected or its status is unknown. true
if the status has been determined by a TSL-Service status, otherwise false.ITSLValidatorResult.isResultFromServiceStatus()public void setResultFromServiceStatus(java.lang.Boolean isResultFromServiceStatusParam)
isResultFromServiceStatusParam - flag that determines if the result has been obtained from a TSL-Service status.public final java.lang.Boolean isResultFromDPorAIA()
isResultFromDPorAIA in interface ITSLValidatorResultnull if the certificate has not been detected or its status is unknown. true
if the status has been determined by a DP or AIA, otherwise false.ITSLValidatorResult.isResultFromDPorAIA()public final void setResultFromDPorAIA(java.lang.Boolean isResultFromDPorAIAParam)
isResultFromDPorAIA.isResultFromDPorAIAParam - The value for the attribute isResultFromDPorAIA.public boolean hasBeenDetectedTheCertificate()
ITSLValidatorResult.RESULT_NOT_DETECTED.hasBeenDetectedTheCertificate in interface ITSLValidatorResulttrue if the result is different of ITSLValidatorResult.RESULT_NOT_DETECTED,
otherwise false.ITSLValidatorResult.hasBeenDetectedTheCertificate()public boolean hasBeenDetectedTheCertificateWithUnknownState()
ITSLValidatorResult.RESULT_DETECTED_STATE_UNKNOWN.hasBeenDetectedTheCertificateWithUnknownState in interface ITSLValidatorResulttrue if the result is equal to ITSLValidatorResult.RESULT_DETECTED_STATE_UNKNOWN,
otherwise false.ITSLValidatorResult.hasBeenDetectedTheCertificateWithUnknownState()public boolean isEuropean()
isEuropean in interface ITSLValidatorResulttrue if the TSL is from an European member, otherwise false.ITSLValidatorResult.isEuropean()public final void setEuropean(boolean isEuropeanParam)
isEuropean.isEuropeanParam - The value for the attribute isEuropean.public java.lang.String getTSPName()
getTSPName in interface ITSLValidatorResultnull if
the certificate has not been detected.ITSLValidatorResult.getTSPName()public final void setTSPName(java.lang.String tspNameParam)
tspName.tspNameParam - The value for the attribute tspName.public final TrustServiceProvider getTSP()
getTSP in interface ITSLValidatorResultnull if
the certificate has not been detected.ITSLValidatorResult.getTSP()public final void setTSP(TrustServiceProvider tspParam)
tsp.tspParam - The value for the attribute tsp.public java.lang.String getTSPServiceNameForDetect()
getTSPServiceNameForDetect in interface ITSLValidatorResultnull if
the certificate has not been detected.ITSLValidatorResult.getTSPServiceNameForDetect()public final void setTSPServiceNameForDetect(java.lang.String tspServiceNameForDetectParam)
tspServiceNameForDetect.tspServiceNameForDetectParam - The value for the attribute tspServiceNameForDetect.public final TSPService getTSPServiceForDetect()
getTSPServiceForDetect in interface ITSLValidatorResultnull if
the certificate has not been detected.ITSLValidatorResult.getTSPServiceForDetect()public final void setTSPServiceForDetect(TSPService tspServiceForDetectParam)
tspServiceForDetect.tspServiceForDetectParam - The value for the attribute tspServiceForDetect.public java.lang.String getTSPServiceHistoryInformationInstanceNameForDetect()
getTSPServiceHistoryInformationInstanceNameForDetect in interface ITSLValidatorResultnull if the certificate has not been detected.ITSLValidatorResult.getTSPServiceHistoryInformationInstanceNameForDetect()public final void setTSPServiceHistoryInformationInstanceNameForDetect(java.lang.String tspServiceHistoryInformationInstanceNameForDetectParam)
tspServiceHistoryInformationInstanceNameForDetect.tspServiceHistoryInformationInstanceNameForDetectParam - The value for the attribute tspServiceHistoryInformationInstanceNameForDetect.public ServiceHistoryInstance getTSPServiceHistoryInformationInstanceForDetect()
getTSPServiceHistoryInformationInstanceForDetect in interface ITSLValidatorResultnull if the certificate has not been detected.ITSLValidatorResult.getTSPServiceHistoryInformationInstanceForDetect()public final void setTSPServiceHistoryInformationInstanceForDetect(ServiceHistoryInstance tspServiceHistoryInformationInstanceForDetectParam)
tspServiceHistoryInformationInstanceForDetect.tspServiceHistoryInformationInstanceForDetectParam - The value for the attribute tspServiceHistoryInformationInstanceForDetect.public java.lang.String getTSPServiceNameForValidate()
getTSPServiceNameForValidate in interface ITSLValidatorResultnull if
the certificate has not been validated.ITSLValidatorResult.getTSPServiceNameForValidate()public final void setTSPServiceNameForValidate(java.lang.String tspServiceNameForValidateParam)
tspServiceNameForValidate.tspServiceNameForValidateParam - The value for the attribute tspServiceNameForValidate.public java.lang.String getTSPServiceHistoryInformationInstanceNameForValidate()
getTSPServiceHistoryInformationInstanceNameForValidate in interface ITSLValidatorResultnull if the certificate has not been validated.ITSLValidatorResult.getTSPServiceHistoryInformationInstanceNameForValidate()public final void setTspServiceHistoryInformationInstanceNameForValidate(java.lang.String tspServiceHistoryInformationInstanceNameForValidateParam)
tspServiceHistoryInformationInstanceNameForValidate.tspServiceHistoryInformationInstanceNameForValidateParam - The value for the attribute tspServiceHistoryInformationInstanceNameForValidate.public ServiceHistoryInstance getTSPServiceHistoryInformationInstanceForValidate()
getTSPServiceHistoryInformationInstanceForValidate in interface ITSLValidatorResultnull if the certificate has not been validated.ITSLValidatorResult.getTSPServiceHistoryInformationInstanceForValidate()public final void setTspServiceHistoryInformationInstanceForValidate(ServiceHistoryInstance tspServiceHistoryInformationInstanceForValidateParam)
tspServiceHistoryInformationInstanceForValidate.tspServiceHistoryInformationInstanceForValidateParam - The value for the attribute tspServiceHistoryInformationInstanceForValidate.public final TSPService getTSPServiceForValidate()
tspServiceForValidate.getTSPServiceForValidate in interface ITSLValidatorResulttspServiceForValidate.public final void setTSPServiceForValidate(TSPService tspServiceForValidateParam)
tspServiceForValidate.tspServiceForValidateParam - The value for the attribute tspServiceForValidate.public int getMappingType()
getMappingType in interface ITSLValidatorResultITSLValidatorResult.getMappingType()public final void setMappingType(int mappingTypeParam)
mappingType.mappingTypeParam - The value for the attribute mappingType.public int getMappingClassification()
ITSLValidatorResult.MAPPING_CLASSIFICATION_OTHER_UNKNOWNITSLValidatorResult#MAPPING_CLASSIFICATION_PERSONITSLValidatorResult.MAPPING_CLASSIFICATION_LEGALPERSONITSLValidatorResult.MAPPING_CLASSIFICATION_ESEALITSLValidatorResult.MAPPING_CLASSIFICATION_ESIGITSLValidatorResult.MAPPING_CLASSIFICATION_WSAITSLValidatorResult.MAPPING_CLASSIFICATION_TSAgetMappingClassification in interface ITSLValidatorResultITSLValidatorResult.getMappingClassification()public final void setMappingClassification(int mappingClassificationParam)
mappingClassification.mappingClassificationParam - The value for the attribute mappingClassification.public int getMappingQSCD()
getMappingQSCD in interface ITSLValidatorResultITSLValidatorResult.getMappingQSCD()public final void setMappingQSCD(int mappingQSCDParam)
mappingQSCD.mappingQSCDParam - The value for the attribute mappingQSCD.public java.util.Map<java.lang.String,java.lang.String> getMappings()
getMappings in interface ITSLValidatorResultITSLValidatorResult.getMappings()public void setMappings(java.util.Map<java.lang.String,java.lang.String> mappings)
setMappings in interface ITSLValidatorResultmappings - Map with the pairs ITSLValidatorResult.setMappings(java.util.Map)public final java.security.cert.X509Certificate getIssuerCert()
getIssuerCert in interface ITSLValidatorResultnull.ITSLValidatorResult.getIssuerCert()public final void setIssuerCert(java.security.cert.X509Certificate issuerCertParam)
issuerCert.issuerCertParam - The value for the attribute issuerCert.public final java.lang.String getIssuerSubjectName()
issuerSubjectName.issuerSubjectName.public final void setIssuerSubjectName(java.lang.String issuerSubjectNameParam)
issuerSubjectName.issuerSubjectNameParam - The value for the attribute issuerSubjectName.public final java.security.PublicKey getIssuerPublicKey()
issuerPublicKey.issuerPublicKey.public final void setIssuerPublicKey(java.security.PublicKey issuerPublicKeyParam)
issuerPublicKey.issuerPublicKeyParam - The value for the attribute issuerPublicKey.public final byte[] getIssuerSKIbytes()
issuerSKIbytes.issuerSKIbytes.public final void setIssuerSKIbytes(byte[] issuerSKIbytesParam)
issuerSKIbytes.issuerSKIbytesParam - The value for the attribute issuerSKIbytes.public final void clearIssuerData()
public org.bouncycastle.cert.ocsp.BasicOCSPResp getRevocationValueBasicOCSPResp()
getRevocationValueBasicOCSPResp in interface ITSLValidatorResultnull if there is not.es.gob.afirma.tsl.certValidation.ifaces.ITSLValidatorResult#getRevocationValueBasicOCSPResponse()public void setRevocationValueBasicOCSPResp(org.bouncycastle.cert.ocsp.BasicOCSPResp bor)
setRevocationValueBasicOCSPResp in interface ITSLValidatorResultbor - Basic OCSP Response to assign how the selected revocation value.es.gob.afirma.tsl.certValidation.ifaces.ITSLValidatorResult#setRevocationValueBasicOCSPResponse(org.bouncycastle.cert.ocsp.BasicOCSPResp)public java.security.cert.X509CRL getRevocationValueCRL()
getRevocationValueCRL in interface ITSLValidatorResultnull if there is not.ITSLValidatorResult.getRevocationValueCRL()public void setRevocationValueCRL(java.security.cert.X509CRL crl)
setRevocationValueCRL in interface ITSLValidatorResultcrl - CRL to assign how the selected revocation value.ITSLValidatorResult.setRevocationValueCRL(java.security.cert.X509CRL)public java.lang.String getRevocationValueURL()
getRevocationValueURL in interface ITSLValidatorResultITSLValidatorResult.getRevocationValueURL()public void setRevocationValueURL(java.lang.String revValueUrlParam)
setRevocationValueURL in interface ITSLValidatorResultrevValueUrlParam - the URL from which the revocation value has been obtained.ITSLValidatorResult.setRevocationValueURL(java.lang.String)public java.util.Date getRevocationDate()
getRevocationDate in interface ITSLValidatorResultnull.ITSLValidatorResult.getRevocationDate()public final void setRevocationDate(java.util.Date revocationDateParam)
revocationDate.revocationDateParam - The value for the attribute revocationDate.public int getRevocationReason()
getRevocationReason in interface ITSLValidatorResultITSLValidatorResult.getRevocationReason()public final void setRevocationReason(int revocationReasonParam)
revocationReason.revocationReasonParam - The value for the attribute revocationReason.public final void resetAllData()