Class FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step3

    • Method Detail

      • useTrustRootCacheFile

        public FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step4 useTrustRootCacheFile​(@NonNull
                                                                                                @NonNull java.io.File cacheFile)
        Cache the trust root certificate in the file cacheFile.

        If cacheFile exists, is a normal file, is readable, matches one of the SHA-256 hashes configured in the previous step, and contains a currently valid X.509 certificate, then it will be used as the trust root for the FIDO Metadata Service blob.

        Otherwise, the trust root certificate will be downloaded and written to this file.

      • useTrustRootCache

        public FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step4 useTrustRootCache​(@NonNull
                                                                                            @NonNull java.util.function.Supplier<java.util.Optional<com.yubico.webauthn.data.ByteArray>> getCachedTrustRootCert,
                                                                                            @NonNull
                                                                                            @NonNull java.util.function.Consumer<com.yubico.webauthn.data.ByteArray> writeCachedTrustRootCert)
        Cache the trust root certificate using a Supplier to read the cache, and using a Consumer to write the cache.

        If getCachedTrustRootCert returns non-empty, the value matches one of the SHA-256 hashes configured in the previous step, and is a currently valid X.509 certificate, then it will be used as the trust root for the FIDO Metadata Service blob.

        Otherwise, the trust root certificate will be downloaded and written to writeCachedTrustRootCert.

        Parameters:
        getCachedTrustRootCert - a Supplier that fetches the cached trust root certificate if it exists. The returned value, if any, should be the trust root certificate in X.509 DER format.
        writeCachedTrustRootCert - a Consumer that accepts the trust root certificate in X.509 DER format and writes it to the cache.