Class CommonCertificateSource

    • Constructor Detail

      • CommonCertificateSource

        public CommonCertificateSource()
        The default constructor to generate a certificates source with an independent certificates pool.
      • CommonCertificateSource

        public CommonCertificateSource​(CertificatePool certPool)
        The default constructor with mandatory certificates pool.
        Parameters:
        certPool - the certificate pool to use
    • Method Detail

      • addCertificate

        public CertificateToken addCertificate​(CertificateToken token)
        This method adds an external certificate to the encapsulated pool and to the source. If the certificate is already present in the pool its source type is associated to the token.
        Specified by:
        addCertificate in interface CertificateSource
        Parameters:
        token - the certificate to add
        Returns:
        the corresponding certificate token
      • removeCertificate

        public boolean removeCertificate​(CertificateToken certificate)
        This method is used internally to remove a certificate from the CertificatePool.
        Parameters:
        certificate - the certificate to be removed
        Returns:
        true if removed
      • getNumberOfCertificates

        public int getNumberOfCertificates()
        This method returns the number of stored certificates in this source
        Returns:
        number of certificates in this instance
      • isTrusted

        public boolean isTrusted​(CertificateToken certificateToken)
        Description copied from interface: CertificateSource
        This method checks if a given certificate is trusted
        Specified by:
        isTrusted in interface CertificateSource
        Parameters:
        certificateToken - the certificate to be tested
        Returns:
        true if the certificate is trusted