Package es.gob.afirma.tsl
Class TslValidation
- java.lang.Object
-
- es.gob.afirma.tsl.TslValidation
-
- All Implemented Interfaces:
ITslValidation
public class TslValidation extends java.lang.Object implements ITslValidation
Class that implements the necessary methods to perform certificate validation using a TSL.
Project:Library for the integration with the services of @Firma, eVisor and TS@.
- Version:
- 1.4, 26/09/2022.
-
-
Field Summary
-
Fields inherited from interface es.gob.afirma.tsl.ITslValidation
PARAM_CERTIFICATE, PARAM_TSLOBJECT
-
-
Constructor Summary
Constructors Constructor Description TslValidation()Constructor method for the class TslValidation.java.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ITSLObjectdownloadTLSbyHTTP(java.lang.String uriTSL, int connectionTimeout, int readTimeout)Method that downloads a TSL from a specified URIITSLObjectgetTSLObjectFromPath(java.lang.String pathTsl)Method to obtain the TSL mapped from a file.DetectCertInTslInfoAndValidationResponsevalidateCertificateTsl(byte[] certByteArrayB64, TSLObject tslObject, java.util.Date detectionDate, boolean getInfo, boolean checkRevStatus)Method that validates a certificate with a given TSL.
-
-
-
Method Detail
-
validateCertificateTsl
public DetectCertInTslInfoAndValidationResponse validateCertificateTsl(byte[] certByteArrayB64, TSLObject tslObject, java.util.Date detectionDate, boolean getInfo, boolean checkRevStatus) throws TSLManagingException
Method that validates a certificate with a given TSL.- Specified by:
validateCertificateTslin interfaceITslValidation- Parameters:
certByteArrayB64- Certificate to detect (byte[] in Base64 encoded).tslObject- TSL object representation to use.detectionDate- Date to use to detect and validate the input certificate.getInfo- Flag that indicates if it is necessary to get the certificate information in response.checkRevStatus- Flag that indicates if it is necessary to check the revocation status of the input certificate.- Returns:
- Structure with detected certificate in TSL and revocation status.
- Throws:
TSLManagingException- If some error is produced in the execution of the service.- See Also:
ITslValidation.validateCertificateTsl(byte[], TSLObject, Date, boolean, boolean)
-
getTSLObjectFromPath
public ITSLObject getTSLObjectFromPath(java.lang.String pathTsl) throws TSLManagingException
Method to obtain the TSL mapped from a file.- Specified by:
getTSLObjectFromPathin interfaceITslValidation- Parameters:
pathTsl- Path where the file with the TSL is located.- Returns:
- a TSL Data Object representation.
- Throws:
TSLManagingException- In case of some error getting the information from the file.- See Also:
ITslValidation.getTSLObjectFromPath(java.lang.String)
-
downloadTLSbyHTTP
public ITSLObject downloadTLSbyHTTP(java.lang.String uriTSL, int connectionTimeout, int readTimeout) throws TSLManagingException
Method that downloads a TSL from a specified URI- Specified by:
downloadTLSbyHTTPin interfaceITslValidation- Parameters:
uriTSL- RL from where the TSL will be downloaded.connectionTimeout- Max millis to connect to server.readTimeout- Max millis to read the response.- Returns:
- a TSL Data Object representation.
- Throws:
TSLManagingException- In case of some error getting the information from the file.- See Also:
ITslValidation.downloadTLSbyHTTP(String, int, int)
-
-