Class CertificatesHelper


  • public class CertificatesHelper
    extends Object
    Manages the certificates of the device.
    • 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.