public class CertificatesHelper extends Object
Modifier and Type | Method and Description |
---|---|
static X509Certificate |
getCertificate(String path)
Gets the X.509 certificate from the resource at the given path.
|
static X509Certificate |
loadCertificate(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.
|
public static X509Certificate getCertificate(String path)
path
- the resource path.IllegalArgumentException
- if the resource does not exist or it does not contain a valid certificate.public static X509Certificate loadCertificate(InputStream inputStream) throws CertificateException
inputStream
- the input stream.CertificateException
- if the input stream does not contain a valid certificate.public static String[] loadCertificatesList(InputStream certificatesList) throws IOException
certificatesList
- the input stream containing the list of certificates.IOException
- if an exception occurs while loading the certificates list.