Package com.yubico.fido.metadata
Class FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step3
- java.lang.Object
-
- com.yubico.fido.metadata.FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step3
-
- Enclosing class:
- FidoMetadataDownloader.FidoMetadataDownloaderBuilder
public static class FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step3 extends java.lang.ObjectStep 3: Configure how to cache the trust root certificate.This step offers two mutually exclusive options:
- Cache the trust root certificate in a
File. SeeuseTrustRootCacheFile(File). - Cache the trust root certificate using a
Supplierto read the cache and aConsumerto write the cache. SeeuseTrustRootCache(Supplier, Consumer).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step4useTrustRootCache(@NonNull java.util.function.Supplier<java.util.Optional<com.yubico.webauthn.data.ByteArray>> getCachedTrustRootCert, @NonNull java.util.function.Consumer<com.yubico.webauthn.data.ByteArray> writeCachedTrustRootCert)Cache the trust root certificate using aSupplierto read the cache, and using aConsumerto write the cache.FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step4useTrustRootCacheFile(@NonNull java.io.File cacheFile)Cache the trust root certificate in the filecacheFile.
-
-
-
Method Detail
-
useTrustRootCacheFile
public FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step4 useTrustRootCacheFile(@NonNull @NonNull java.io.File cacheFile)
Cache the trust root certificate in the filecacheFile.If
cacheFileexists, 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 aSupplierto read the cache, and using aConsumerto write the cache.If
getCachedTrustRootCertreturns 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- aSupplierthat 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- aConsumerthat accepts the trust root certificate in X.509 DER format and writes it to the cache.
-
-