Class FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step3
- Enclosing class:
FidoMetadataDownloader.FidoMetadataDownloaderBuilder
This step offers two mutually exclusive options:
- Cache trust root certificates in a
File. SeeuseTrustRootCacheFile(File). - Cache trust root certificates using a
Supplierto read the cache and aConsumerto write the cache. SeeuseTrustRootCache(Supplier, Consumer).
-
Method Summary
Modifier and TypeMethodDescriptionuseTrustRootCache(@NonNull Supplier<Optional<ByteArray>> getCachedTrustRootCerts, @NonNull Consumer<ByteArray> writeCachedTrustRootCerts) useTrustRootCacheFile(@NonNull File cacheFile) Cache trust root certificates in the filecacheFile.
-
Method Details
-
useTrustRootCacheFile
public FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step4 useTrustRootCacheFile(@NonNull @NonNull File cacheFile) Cache trust root certificates in the filecacheFile.If
cacheFileexists, is a normal file and is readable, then trust root certificates will be attempted to be read from this file. The internal format of the file is opaque and subject to change without a major version release of the library.If reading from the cache fails, then trust root certificates will instead be downloaded and written to this file.
The cache is invalidated whenever the configured list of trust root download URLs changes or differs in length from the number of cached certificates, or whenever any cached certificate matches none of the configured SHA-256 hashes.
-
useTrustRootCache
public FidoMetadataDownloader.FidoMetadataDownloaderBuilder.Step4 useTrustRootCache(@NonNull @NonNull Supplier<Optional<ByteArray>> getCachedTrustRootCerts, @NonNull @NonNull Consumer<ByteArray> writeCachedTrustRootCerts) Cache the trust root certificate using aSupplierto read the cache, and using aConsumerto write the cache.If
getCachedTrustRootCertsreturns non-empty, then trust root certificates will be attempted to be read from the containedByteArray. The internal format of the byte array is opaque and subject to change without a major version release of the library.If the supplier returns empty or reading from the contained byte array fails, then trust root certificates will be downloaded and written to
writeCachedTrustRootCerts.The cache is invalidated whenever the configured list of trust root download URLs changes or differs in length from the number of cached certificates, or whenever any cached certificate matches none of the configured SHA-256 hashes.
- Parameters:
getCachedTrustRootCerts- aSupplierthat fetches cached trust root certificates if they exist. MUST NOT returnnull. The format of the returned value, if present, is opaque to the supplier.writeCachedTrustRootCerts- aConsumerthat accepts trust root certificates in an unspecified opaque format and writes it to the cache. Its argument will never benull.
-