Package com.yubico.fido.metadata
Class FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step5
- java.lang.Object
-
- com.yubico.fido.metadata.FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step5
-
- Enclosing class:
- FidoMetadataDownloader.FidoMetadataDownloaderBuilder
public static class FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step5 extends java.lang.ObjectStep 5: Configure how to cache the metadata BLOB.This step offers two mutually exclusive options:
- Cache the metadata BLOB in a
File. SeeuseBlobCacheFile(File). - Cache the metadata BLOB using a
Supplierto read the cache and aConsumerto write the cache. SeeuseBlobCache(Supplier, Consumer).
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FidoMetadataDownloader.FidoMetadataDownloaderBuilderuseBlobCache(@NonNull java.util.function.Supplier<java.util.Optional<com.yubico.webauthn.data.ByteArray>> getCachedBlob, @NonNull java.util.function.Consumer<com.yubico.webauthn.data.ByteArray> writeCachedBlob)Cache the metadata BLOB using aSupplierto read the cache, and using aConsumerto write the cache.FidoMetadataDownloader.FidoMetadataDownloaderBuilderuseBlobCacheFile(@NonNull java.io.File cacheFile)Cache metadata BLOB in the filecacheFile.
-
-
-
Method Detail
-
useBlobCacheFile
public FidoMetadataDownloader.FidoMetadataDownloaderBuilder useBlobCacheFile(@NonNull @NonNull java.io.File cacheFile)
Cache metadata BLOB in the filecacheFile.If
cacheFileexists, is a normal file, is readable, and is not out of date, then it will be used as the FIDO Metadata Service BLOB.Otherwise, the metadata BLOB will be downloaded and written to this file.
- Parameters:
cacheFile- aFilewhich may or may not exist. If it exists, it should contain the metadata BLOB in JWS compact serialization format [RFC7515].
-
useBlobCache
public FidoMetadataDownloader.FidoMetadataDownloaderBuilder useBlobCache(@NonNull @NonNull java.util.function.Supplier<java.util.Optional<com.yubico.webauthn.data.ByteArray>> getCachedBlob, @NonNull @NonNull java.util.function.Consumer<com.yubico.webauthn.data.ByteArray> writeCachedBlob)
Cache the metadata BLOB using aSupplierto read the cache, and using aConsumerto write the cache.If
getCachedBlobreturns non-empty and the content is not out of date, then it will be used as the FIDO Metadata Service BLOB.Otherwise, the metadata BLOB will be downloaded and written to
writeCachedBlob.- Parameters:
getCachedBlob- aSupplierthat fetches the cached metadata BLOB if it exists. The returned value, if any, should be in JWS compact serialization format [RFC7515].writeCachedBlob- aConsumerthat accepts the metadata BLOB in JWS compact serialization format [RFC7515] and writes it to the cache.
-
-