Class SSLCertificateLoader
java.lang.Object
eu.europa.esig.dss.service.http.commons.SSLCertificateLoader
- All Implemented Interfaces:
Serializable
The data loader which includes server webpage certificates to the response context
Use the method getCertificates(url) to extract the data
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static classThis class consumes theClassicHttpResponsebut does not process or return any content. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCertificates(String urlString) The method to extract SSL-certificates from the given web pageprotected CommonsDataLoaderGets theCommonsDataLoaderimplementationprotected Certificate[]This method gets the certificates obtained from a TLS/SSL connectionprotected Certificate[]readCertificates(org.apache.hc.core5.http.protocol.HttpContext context) This method reads the TSL/SSL connection details from theHttpContextand returns an array ofCertificate, when applicable.voidsetCommonsDataLoader(CommonsDataLoader commonsDataLoader) Allows to set a pre-configured CommonsDataLoaderprotected List<CertificateToken> toCertificateTokens(Certificate[] certificates) This method converts an array ofjava.security.cert.Certificates to a list ofeu.europa.esig.dss.model.x509.CertificateTokens
-
Constructor Details
-
SSLCertificateLoader
public SSLCertificateLoader()Default constructor with null CommonsDataLoader
-
-
Method Details
-
setCommonsDataLoader
Allows to set a pre-configured CommonsDataLoader- Parameters:
commonsDataLoader-CommonsDataLoaderto use
-
getCommonsDataLoader
Gets theCommonsDataLoaderimplementation- Returns:
CommonsDataLoader
-
getCertificates
The method to extract SSL-certificates from the given web page- Parameters:
urlString-Stringrepresenting a URL of a webpage with a secure connection (HTTPS)- Returns:
- a
CertificateTokenchain of the secure webpage
-
httpGetCertificates
This method gets the certificates obtained from a TLS/SSL connection- Parameters:
url-StringURL address to connect to- Returns:
- an array of
Certificates
-
toCertificateTokens
This method converts an array ofjava.security.cert.Certificates to a list ofeu.europa.esig.dss.model.x509.CertificateTokens- Parameters:
certificates- an array ofCertificateto convert- Returns:
- a list of
CertificateTokens
-
readCertificates
protected Certificate[] readCertificates(org.apache.hc.core5.http.protocol.HttpContext context) throws IOException This method reads the TSL/SSL connection details from theHttpContextand returns an array ofCertificate, when applicable. WARN: thecontextshall be an instance ofHttpCoreContext.- Parameters:
context-HttpContextto read- Returns:
- an array of
Certificates - Throws:
IOException- if an exception occurs on HttpContext reading
-