Class SimpleTrustResolver

  • All Implemented Interfaces:
    TrustResolver

    public final class SimpleTrustResolver
    extends java.lang.Object
    implements TrustResolver
    Assesses whether an argument certificate can be trusted, and if so, by what trusted root certificate.
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleTrustResolver​(java.lang.Iterable<java.security.cert.X509Certificate> trustedCertificates)  
    • Constructor Detail

      • SimpleTrustResolver

        public SimpleTrustResolver​(java.lang.Iterable<java.security.cert.X509Certificate> trustedCertificates)
    • Method Detail

      • fromMetadata

        public static SimpleTrustResolver fromMetadata​(java.lang.Iterable<MetadataObject> metadataObjects)
                                                throws java.security.cert.CertificateException
        Throws:
        java.security.cert.CertificateException
      • fromMetadataJson

        public static SimpleTrustResolver fromMetadataJson​(java.lang.String metadataObjectJson)
                                                    throws java.io.IOException,
                                                           java.security.cert.CertificateException
        Throws:
        java.io.IOException
        java.security.cert.CertificateException
      • resolveTrustAnchor

        public java.util.Optional<java.security.cert.X509Certificate> resolveTrustAnchor​(java.security.cert.X509Certificate attestationCertificate,
                                                                                         java.util.List<java.security.cert.X509Certificate> caCertificateChain)
        Description copied from interface: TrustResolver
        Resolve a trusted root anchor for the given attestation certificate and certificate chain
        Specified by:
        resolveTrustAnchor in interface TrustResolver
        Parameters:
        attestationCertificate - The attestation certificate
        caCertificateChain - Zero or more certificates, of which the first has signed attestationCertificate and each of the remaining certificates has signed the certificate preceding it.
        Returns:
        A trusted root certificate from which there is a signature path to attestationCertificate, if one exists.