Class Trust


  • public final class Trust
    extends Object
    The Trust contains the root certificates and any intermediate certificates you choose to trust in your application. It can then be used to resolve the certificatation path of a certificate, and determined if it is trusted or not.
    • Method Detail

      • from

        public static Trust from​(Clock clock,
                                 X509Certificate... trustedCertificates)
        Construct a Trust from the given trusted certificates.
        Parameters:
        trustedCertificates - all the certificates, both trust anchors and any intermediate certificates issued from any of the trust anchors
        clock - the clock to use for asserting certificate validity
        Returns:
        the Trust for the given certificates
      • from

        public static Trust from​(Clock clock,
                                 Stream<X509Certificate> trustedCertificates)
        Construct a Trust from the given trusted certificates.
        Parameters:
        trustedCertificates - all the certificates, both trust anchors and any intermediate certificates issued from any of the trust anchors
        clock - the clock to use for asserting certificate validity
        Returns:
        the Trust for the given certificates
      • merge

        public static Trust merge​(Trust t1,
                                  Trust t2)
        Merge two Trusts. The resulting trust will be the union of the given trusts.
        Parameters:
        t1 - the first trust
        t2 - the second trust
        Returns:
        the resulting trust from merging t1 and t2
      • trusts

        public boolean trusts​(CertPath certPath)
        Determine if a certificate path is trusted or not
        Returns:
        true if the path is trusted, false otherwise.
      • getTrustAnchorCertificates

        public Set<X509Certificate> getTrustAnchorCertificates()
        A trust anchor is the authoritative entity for which trust is assumed and not derived, i.e. the root certificates from which the whole chain of trust is derived.
        Returns:
        the trust anchor certificates of this Trust
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object