Package net.shibboleth.idp.plugin.authn.webauthn.storage

# Class EnhancedCredentialRecord

java.lang.Object
net.shibboleth.idp.plugin.authn.webauthn.storage.EnhancedCredentialRecord

public class EnhancedCredentialRecord extends Object
An ephemeral wrapper class that holds a `CredentialRecord` and any associated metadata. Created and used during registration or authentication and then discarded. This is not meant to be serialised or stored.

## Field Summary

Fields
Modifier and Type
Field
Description
`private AaguidEntry`
`aaguidMetadata`
An AAGUID entry provided by a supplementary JSON file that describes authenticators not in the MDS feed e.g.
`private Set<com.yubico.fido.metadata.MetadataBLOBPayloadEntry>`
`authenticatorMetadata`
Optional metadata about the authenticator.
`private final CredentialRecord`
`credentialRecord`
The wrapped credential record.
`private List<String>`
`labels`
Labels that can be set about the credential or authenticator that created it.

## Constructor Summary

Constructors
Constructor
Description
`EnhancedCredentialRecord(CredentialRecord credential)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`String`
`getAuthenticatorDescription()`
Get the human-readable, short description of the authenticator (in English) iff either; the attestation metadata exists or aaguid metadata exists (preferencing the FIDO2 attestation metadata).
`Set<com.yubico.fido.metadata.MetadataBLOBPayloadEntry>`
`getAuthenticatorMetadata()`
Get the authenticator metadata.
`CredentialRecord`
`getCredentialRecord()`
Get the wrapped credential record.
`String`
`getIcon()`
Get a `data:` URL encoded PNG icon for the authenticator.
`List<String>`
`getLabels()`
Get labels about the credential or the authenticator that created it.
`void`
`setAaguidMetadata(AaguidEntry metadata)`
Set the AAGUID entry that describes the authenticator.
`void`
`setAuthenticatorMetadata(Set<com.yubico.fido.metadata.MetadataBLOBPayloadEntry> metadata)`
Set the authenticator metadata.
`void`
`setLabels(List<String> labelsIn)`
Set labels about the credential or authenticator that created it.

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### credentialRecord

@Nonnull private final CredentialRecord credentialRecord
The wrapped credential record.

### authenticatorMetadata

@Nonnull @Unmodifiable @NonnullElements @NotLive private Set<com.yubico.fido.metadata.MetadataBLOBPayloadEntry> authenticatorMetadata
Optional metadata about the authenticator. Will be an empty set if not used.

### aaguidMetadata

@Nullable private AaguidEntry aaguidMetadata
An AAGUID entry provided by a supplementary JSON file that describes authenticators not in the MDS feed e.g. for software providers. Supplies a description and icon for UI only.

### labels

@Nonnull @Unmodifiable @NonnullElements @NotLive private List<String> labels
Labels that can be set about the credential or authenticator that created it. For display only.

## Constructor Details

### EnhancedCredentialRecord

public EnhancedCredentialRecord(@Nonnull CredentialRecord credential)
Constructor.

Parameters:
  `credential` - the credential to wrap.

## Method Details

### getCredentialRecord

@Nonnull public CredentialRecord getCredentialRecord()
Get the wrapped credential record.

Returns:
  the wrapped credential record.

### setAuthenticatorMetadata

public void setAuthenticatorMetadata(@Nullable Set<com.yubico.fido.metadata.MetadataBLOBPayloadEntry> metadata)
Set the authenticator metadata.

Parameters:
  `metadata` - The authenticator metadata to set.

### getAuthenticatorMetadata

@Nonnull @Unmodifiable @NonnullElements @NotLive public Set<com.yubico.fido.metadata.MetadataBLOBPayloadEntry> getAuthenticatorMetadata()
Get the authenticator metadata.

Returns:
  Returns the attestationMetadata.

### setAaguidMetadata

public void setAaguidMetadata(@Nullable AaguidEntry metadata)
Set the AAGUID entry that describes the authenticator. Typically set for those authenticators that are not in the FIDO MDS feed.

Parameters:
  `metadata` - The aaguid metadata to set.

### setLabels

public void setLabels(@Nonnull List<String> labelsIn)
Set labels about the credential or authenticator that created it. For display only.

Parameters:
  `labelsIn` - The labels to set.

### getLabels

@Nonnull @Unmodifiable @NonnullElements @NotLive public List<String> getLabels()
Get labels about the credential or the authenticator that created it. For display only.

Returns:
  the labels.

### getAuthenticatorDescription

@Nullable public String getAuthenticatorDescription()
Get the human-readable, short description of the authenticator (in English) iff either; the attestation metadata exists or aaguid metadata exists (preferencing the FIDO2 attestation metadata).

If there is more than one metadata entry, pick the first it can find with a description.

Returns:
  the human-readable, short description of the authenticator (in English), or `null`.

### getIcon

@Nullable public String getIcon()
Get a `data:` URL encoded PNG icon for the authenticator.

If there is more than one metadata entry, pick the first it can find with an icon. If the FIDO2 attestation metadata does not exist, the icon is looked up in the aaguid metadata.

Returns:
  the icon encoded as a PNG `data:` URL