Package com.yubico.fido.metadata
Class FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step5
java.lang.Object
com.yubico.fido.metadata.FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step5
- Enclosing class:
- FidoMetadataDownloader.FidoMetadataDownloaderBuilder
Step 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
Supplier
to read the cache and aConsumer
to write the cache. SeeuseBlobCache(Supplier, Consumer)
.
-
Method Summary
Modifier and TypeMethodDescriptionuseBlobCache
(@NonNull Supplier<Optional<com.yubico.webauthn.data.ByteArray>> getCachedBlob, @NonNull Consumer<com.yubico.webauthn.data.ByteArray> writeCachedBlob) useBlobCacheFile
(@NonNull File cacheFile) Cache metadata BLOB in the filecacheFile
.
-
Method Details
-
useBlobCacheFile
public FidoMetadataDownloader.FidoMetadataDownloaderBuilder useBlobCacheFile(@NonNull @NonNull File cacheFile) Cache metadata BLOB in the filecacheFile
.If
cacheFile
exists, 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.
-
useBlobCache
public FidoMetadataDownloader.FidoMetadataDownloaderBuilder useBlobCache(@NonNull @NonNull Supplier<Optional<com.yubico.webauthn.data.ByteArray>> getCachedBlob, @NonNull @NonNull Consumer<com.yubico.webauthn.data.ByteArray> writeCachedBlob) Cache the metadata BLOB using aSupplier
to read the cache, and using aConsumer
to write the cache.If
getCachedBlob
returns 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
- aSupplier
that fetches the cached metadata BLOB if it exists. The returned value, if any, should be in JWS compact serialization format [RFC7515].writeCachedBlob
- aConsumer
that accepts the metadata BLOB in JWS compact serialization format [RFC7515] and writes it to the cache.
-