Class FidoMetadataService
- java.lang.Object
-
- com.yubico.fido.metadata.FidoMetadataService
-
- All Implemented Interfaces:
com.yubico.webauthn.attestation.AttestationTrustSource
public final class FidoMetadataService extends java.lang.Object implements com.yubico.webauthn.attestation.AttestationTrustSource
Utility for filtering and querying Fido Metadata Service BLOB entries.This class implements
AttestationTrustSource
, so it can be configured as theattestationTrustSource
setting inRelyingParty
.The metadata service may be configured with a two stages of filters to select trusted authenticators. The first stage is the
prefilter
setting, which is executed once when theFidoMetadataService
instance is constructed. The second stage is thefilter
setting, which is executed whenever metadata or trust roots are to be looked up for a given authenticator. Any metadata entry that satisfies both filters will be considered trusted.Use the
builder
to configure settings, then use thefindEntries(List, AAGUID)
method or its overloads to retrieve metadata entries.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FidoMetadataService.FidoMetadataServiceBuilder
static class
FidoMetadataService.Filters
Preconfigured filters and utilities for combining filters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static FidoMetadataService.FidoMetadataServiceBuilder.Step1
builder()
java.util.Set<MetadataBLOBPayloadEntry>
findEntries(@NonNull AAGUID aaguid)
Find metadata entries matching the given AAGUID.java.util.Set<MetadataBLOBPayloadEntry>
findEntries(@NonNull com.yubico.webauthn.RegistrationResult registrationResult)
Find metadata entries matching the credential represented byregistrationResult
.java.util.Set<MetadataBLOBPayloadEntry>
findEntries(@NonNull java.util.function.Predicate<MetadataBLOBPayloadEntry> filter)
Retrieve metadata entries matching the given filter.java.util.Set<MetadataBLOBPayloadEntry>
findEntries(@NonNull java.util.List<java.security.cert.X509Certificate> attestationCertificateChain)
Alias offindEntries(attestationCertificateChain, Optional.empty())
.java.util.Set<MetadataBLOBPayloadEntry>
findEntries(@NonNull java.util.List<java.security.cert.X509Certificate> attestationCertificateChain, @NonNull AAGUID aaguid)
Alias offindEntries(attestationCertificateChain, Optional.of(aaguid))
.java.util.Set<MetadataBLOBPayloadEntry>
findEntries(@NonNull java.util.List<java.security.cert.X509Certificate> attestationCertificateChain, @NonNull java.util.Optional<AAGUID> aaguid)
Look up metadata entries matching a given attestation certificate chain or AAGUID.com.yubico.webauthn.attestation.AttestationTrustSource.TrustRootsResult
findTrustRoots(java.util.List<java.security.cert.X509Certificate> attestationCertificateChain, java.util.Optional<com.yubico.webauthn.data.ByteArray> aaguid)
-
-
-
Method Detail
-
builder
public static FidoMetadataService.FidoMetadataServiceBuilder.Step1 builder()
-
findEntries
public java.util.Set<MetadataBLOBPayloadEntry> findEntries(@NonNull @NonNull java.util.List<java.security.cert.X509Certificate> attestationCertificateChain, @NonNull @NonNull java.util.Optional<AAGUID> aaguid)
Look up metadata entries matching a given attestation certificate chain or AAGUID.- Parameters:
attestationCertificateChain
- an attestation certificate chain, presumably from a WebAuthn attestation statement.aaguid
- the AAGUID of the authenticator to look up, if available.- Returns:
- All metadata entries which satisfy ALL of the following:
- It satisfies the
prefilter
. - It satisfies AT LEAST ONE of the following:
aaguid
is present and equals theAAGUID
of the metadata entry.aaguid
is present and equals theAAGUID
of themetadata statement
, if any, in the metadata entry.- The certificate subject key identifier of any certificate in
attestationCertificateChain
matches any element ofattestationCertificateKeyIdentifiers
in the metadata entry. - The certificate subject key identifier of any certificate in
attestationCertificateChain
matches any element ofattestationCertificateKeyIdentifiers
in themetadata statement
, if any, in the metadata entry.
- It satisfies the
filter
together withattestationCertificateChain
andaaguid
.
- It satisfies the
- See Also:
findEntries(List)
,findEntries(List, AAGUID)
-
findEntries
public java.util.Set<MetadataBLOBPayloadEntry> findEntries(@NonNull @NonNull java.util.List<java.security.cert.X509Certificate> attestationCertificateChain)
Alias offindEntries(attestationCertificateChain, Optional.empty())
.- See Also:
findEntries(List, Optional)
-
findEntries
public java.util.Set<MetadataBLOBPayloadEntry> findEntries(@NonNull @NonNull java.util.List<java.security.cert.X509Certificate> attestationCertificateChain, @NonNull @NonNull AAGUID aaguid)
Alias offindEntries(attestationCertificateChain, Optional.of(aaguid))
.- See Also:
findEntries(List, Optional)
-
findEntries
public java.util.Set<MetadataBLOBPayloadEntry> findEntries(@NonNull @NonNull com.yubico.webauthn.RegistrationResult registrationResult)
Find metadata entries matching the credential represented byregistrationResult
.This is an alias of:
registrationResult.getAttestationTrustPath() .map(atp -> this.findEntries(atp, new AAGUID(registrationResult.getAaguid()))) .orElseGet(Collections::emptySet)
- See Also:
findEntries(List, Optional)
-
findEntries
public java.util.Set<MetadataBLOBPayloadEntry> findEntries(@NonNull @NonNull AAGUID aaguid)
Find metadata entries matching the given AAGUID.- See Also:
findEntries(List, Optional)
-
findEntries
public java.util.Set<MetadataBLOBPayloadEntry> findEntries(@NonNull @NonNull java.util.function.Predicate<MetadataBLOBPayloadEntry> filter)
Retrieve metadata entries matching the given filter.Note: The result MAY include fewer results than the number of times the
filter
returnedtrue
, because of possible duplication in the underlying data store.- Parameters:
filter
- aPredicate
which returnstrue
for metadata entries to include in the result.- Returns:
- All metadata entries which which satisfy the
prefilter
AND for which thefilter
returnstrue
. - See Also:
findEntries(List, Optional)
-
findTrustRoots
public com.yubico.webauthn.attestation.AttestationTrustSource.TrustRootsResult findTrustRoots(java.util.List<java.security.cert.X509Certificate> attestationCertificateChain, java.util.Optional<com.yubico.webauthn.data.ByteArray> aaguid)
- Specified by:
findTrustRoots
in interfacecom.yubico.webauthn.attestation.AttestationTrustSource
-
-