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

# Class RegistrationResult

java.lang.Object
net.shibboleth.idp.plugin.authn.webauthn.admin.RegistrationResult

@ThreadSafe @Immutable public final class RegistrationResult extends Object
The result of a call to `(com.yubico.webauthn.data.PublicKeyCredentialCreationOptions, com.yubico.webauthn.data.PublicKeyCredential)`.

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static final class`
`RegistrationResult.Builder`
Builder.
`static interface`
`RegistrationResult.IAttestationTrustedStage`
Builder stage.
`static interface`
`RegistrationResult.IAttestationTypeStage`
Builder stage.
`static interface`
`RegistrationResult.IBuildStage`
Builder stage.
`static interface`
`RegistrationResult.ICredentialStage`
Builder stage.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final boolean`
`attestationTrusted`
Is the attestation signature valid.
`private final com.yubico.webauthn.data.AttestationType`
`attestationType`
The attestation type that was used for this credential.
`private final com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAttestationResponse,com.yubico.webauthn.data.ClientRegistrationExtensionOutputs>`
`credential`
The verified attestation response.

## Constructor Summary

Constructors
Modifier
Constructor
Description
`private`
`RegistrationResult(RegistrationResult.Builder builder)`
Private constructor for use by the builder.

## Method Summary

Modifier and Type
Method
Description
`static RegistrationResult.IAttestationTrustedStage`
`builder()`
Get the builder used to construct this object.
`com.yubico.webauthn.data.ByteArray`
`getAaguid()`
Get the AAGUID of the authenticator.
`final com.yubico.webauthn.data.AttestationType`
`getAttestationType()`
The attestation type that was used for this credential.
`final com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAttestationResponse,com.yubico.webauthn.data.ClientRegistrationExtensionOutputs>`
`getCredential()`
Get the attestation response.
`com.yubico.webauthn.data.PublicKeyCredentialDescriptor`
`getKeyId()`
Get the credential ID and transports of the created credential.
`com.yubico.webauthn.data.ByteArray`
`getPublicKeyCose()`
Get the public key of the created credential in COSE format.
`final boolean`
`isAttestationTrusted()`
Is the attestation signature valid.
`Optional<Boolean>`
`isDiscoverable()`
Try to determine if this credential is a discoverable (passkey) type by inspecting the ResidentKey flag inside the credential properties extension.
`boolean`
`isUserVerified()`
Was the user verified by a suitable authorization gesture during the registration ceremony?

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

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

## Field Details

### attestationTrusted

private final boolean attestationTrusted
Is the attestation signature valid. Does it link to a trusted root attestation.

Note, this is different than if the assertion signature is valid.

### attestationType

@Nonnull private final com.yubico.webauthn.data.AttestationType attestationType
The attestation type that was used for this credential. This only applies to attestation statements if requested.

### credential

@Nonnull private final com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAttestationResponse,com.yubico.webauthn.data.ClientRegistrationExtensionOutputs> credential
The verified attestation response.

## Constructor Details

### RegistrationResult

private RegistrationResult(RegistrationResult.Builder builder)
Private constructor for use by the builder.

Parameters:
  `builder` - the builder used to set the fields of this class

## Method Details

### isAttestationTrusted

public final boolean isAttestationTrusted()
Is the attestation signature valid. Does it link to a trusted root attestation.

Note, this is different than if the assertion signature is valid.

Returns:
  true if the attestation signature is valid, false otherwise.

### getAttestationType

@Nonnull public final com.yubico.webauthn.data.AttestationType getAttestationType()
The attestation type that was used for this credential. This only applies to attestation statements iff requested.

Returns:
  the attestation type.

### getKeyId

@Nonnull public com.yubico.webauthn.data.PublicKeyCredentialDescriptor getKeyId()
Get the credential ID and transports of the created credential.

Returns:
  the credential ID and transports of the created credential.

### getPublicKeyCose

@Nullable public com.yubico.webauthn.data.ByteArray getPublicKeyCose()
Get the public key of the created credential in COSE format.

Returns:
  the public key, `null` if not found.

### getAaguid

@Nullable public com.yubico.webauthn.data.ByteArray getAaguid()
Get the AAGUID of the authenticator.

Returns:
  the AAGUID of the authenticator, `null` if not found.

### isDiscoverable

@Nonnull public Optional<Boolean> isDiscoverable()
Try to determine if this credential is a discoverable (passkey) type by inspecting the ResidentKey flag inside the credential properties extension.

Returns:
  true if the credential is discoverable (a passkey), false if it is not, or empty if not known e.g. the extensions were not returned.

### isUserVerified

public boolean isUserVerified()
Was the user verified by a suitable authorization gesture during the registration ceremony?

Returns:
  true if the authenticator claims to have performed user verification, false otherwise.

### getCredential

@Nonnull public final com.yubico.webauthn.data.PublicKeyCredential<com.yubico.webauthn.data.AuthenticatorAttestationResponse,com.yubico.webauthn.data.ClientRegistrationExtensionOutputs> getCredential()
Get the attestation response.

Returns:
  the credential

### builder

@Nonnull public static RegistrationResult.IAttestationTrustedStage builder()
Get the builder used to construct this object.

Returns:
  the builder