Package ej.net.util.ssl
Class CertificatesHelper
- java.lang.Object
-
- ej.net.util.ssl.CertificatesHelper
-
public class CertificatesHelper extends Object
Manages the certificates of the device.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static X509CertificategetCertificate(String path)Gets the X.509 certificate from the resource at the given path.static X509CertificateloadCertificate(InputStream inputStream)Loads the X.509 certificate from the given input stream.static String[]loadCertificatesList(InputStream certificatesList)Loads a list of certificates by reading an input stream which contains the filename of each certificate.
-
-
-
Method Detail
-
loadCertificate
public static X509Certificate loadCertificate(InputStream inputStream) throws CertificateException
Loads the X.509 certificate from the given input stream.- Parameters:
inputStream- the input stream.- Returns:
- the certificate.
- Throws:
CertificateException- if the input stream does not contain a valid certificate.
-
getCertificate
public static X509Certificate getCertificate(String path)
Gets the X.509 certificate from the resource at the given path.- Parameters:
path- the resource path.- Returns:
- the certificate.
- Throws:
IllegalArgumentException- if the resource does not exist or it does not contain a valid certificate.
-
loadCertificatesList
public static String[] loadCertificatesList(InputStream certificatesList) throws IOException
Loads a list of certificates by reading an input stream which contains the filename of each certificate.- Parameters:
certificatesList- the input stream containing the list of certificates.- Returns:
- an array containing the filenames of the certificates.
- Throws:
IOException- if an exception occurs while loading the certificates list.
-
-