java.lang.Object
com.webauthn4j.WebAuthnRegistrationManager
Manager class for WebAuthn registration operations.
This class provides methods for parsing and verifying WebAuthn registration data.
It handles the registration phase of the WebAuthn authentication process, including
attestation verification, certificate path validation, and custom registration verification.
-
Constructor Summary
ConstructorsConstructorDescriptionWebAuthnRegistrationManager(@NotNull List<AttestationStatementVerifier> attestationStatementVerifiers, @NotNull CertPathTrustworthinessVerifier certPathTrustworthinessVerifier, @NotNull SelfAttestationTrustworthinessVerifier selfAttestationTrustworthinessVerifier) Constructor for WebAuthnRegistrationManager with custom verifiers and default object converterWebAuthnRegistrationManager(@NotNull List<AttestationStatementVerifier> attestationStatementVerifiers, @NotNull CertPathTrustworthinessVerifier certPathTrustworthinessVerifier, @NotNull SelfAttestationTrustworthinessVerifier selfAttestationTrustworthinessVerifier, @NotNull ObjectConverter objectConverter) Constructor for WebAuthnRegistrationManager with custom verifiers and object converterWebAuthnRegistrationManager(@NotNull List<AttestationStatementVerifier> attestationStatementVerifiers, @NotNull CertPathTrustworthinessVerifier certPathTrustworthinessVerifier, @NotNull SelfAttestationTrustworthinessVerifier selfAttestationTrustworthinessVerifier, @NotNull List<CustomRegistrationVerifier> customRegistrationVerifiers) Constructor for WebAuthnRegistrationManager with custom verifiersWebAuthnRegistrationManager(@NotNull List<AttestationStatementVerifier> attestationStatementVerifiers, @NotNull CertPathTrustworthinessVerifier certPathTrustworthinessVerifier, @NotNull SelfAttestationTrustworthinessVerifier selfAttestationTrustworthinessVerifier, @NotNull List<CustomRegistrationVerifier> customRegistrationVerifiers, @NotNull ObjectConverter objectConverter) Constructor for WebAuthnRegistrationManager with full customization options -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull WebAuthnRegistrationManagerCreatesWebAuthnRegistrationManagerwith non strict configurationstatic @NotNull WebAuthnRegistrationManagercreateNonStrictWebAuthnRegistrationManager(@NotNull ObjectConverter objectConverter) CreatesWebAuthnManagerwith non strict configuration@NotNull RegistrationDataVerifierGets the registration data verifier@NotNull RegistrationDataparse(@NotNull RegistrationRequest registrationRequest) Parses a WebAuthn registration request@NotNull RegistrationDataparse(@NotNull InputStream registrationResponseJSON) Parses a WebAuthn registration response JSON from an input stream@NotNull RegistrationDataParses a WebAuthn registration response JSON string@NotNull RegistrationDataverify(@NotNull RegistrationData registrationData, @NotNull RegistrationParameters registrationParameters) Verifies WebAuthn registration data@NotNull RegistrationDataverify(@NotNull RegistrationRequest registrationRequest, @NotNull RegistrationParameters registrationParameters) Verifies a WebAuthn registration request@NotNull RegistrationDataverify(@NotNull InputStream registrationResponseJSON, @NotNull RegistrationParameters registrationParameters) Verifies a WebAuthn registration response JSON from an input stream@NotNull RegistrationDataverify(@NotNull String registrationResponseJSON, @NotNull RegistrationParameters registrationParameters) Verifies a WebAuthn registration response JSON string
-
Constructor Details
-
WebAuthnRegistrationManager
public WebAuthnRegistrationManager(@NotNull @NotNull List<AttestationStatementVerifier> attestationStatementVerifiers, @NotNull @NotNull CertPathTrustworthinessVerifier certPathTrustworthinessVerifier, @NotNull @NotNull SelfAttestationTrustworthinessVerifier selfAttestationTrustworthinessVerifier, @NotNull @NotNull List<CustomRegistrationVerifier> customRegistrationVerifiers, @NotNull @NotNull ObjectConverter objectConverter) Constructor for WebAuthnRegistrationManager with full customization options- Parameters:
attestationStatementVerifiers- list of attestation statement verifierscertPathTrustworthinessVerifier- verifier for certification path trustworthinessselfAttestationTrustworthinessVerifier- verifier for self attestation trustworthinesscustomRegistrationVerifiers- list of custom registration verifiersobjectConverter- converter for object serialization/deserialization
-
WebAuthnRegistrationManager
public WebAuthnRegistrationManager(@NotNull @NotNull List<AttestationStatementVerifier> attestationStatementVerifiers, @NotNull @NotNull CertPathTrustworthinessVerifier certPathTrustworthinessVerifier, @NotNull @NotNull SelfAttestationTrustworthinessVerifier selfAttestationTrustworthinessVerifier, @NotNull @NotNull List<CustomRegistrationVerifier> customRegistrationVerifiers) Constructor for WebAuthnRegistrationManager with custom verifiers- Parameters:
attestationStatementVerifiers- list of attestation statement verifierscertPathTrustworthinessVerifier- verifier for certification path trustworthinessselfAttestationTrustworthinessVerifier- verifier for self attestation trustworthinesscustomRegistrationVerifiers- list of custom registration verifiers
-
WebAuthnRegistrationManager
public WebAuthnRegistrationManager(@NotNull @NotNull List<AttestationStatementVerifier> attestationStatementVerifiers, @NotNull @NotNull CertPathTrustworthinessVerifier certPathTrustworthinessVerifier, @NotNull @NotNull SelfAttestationTrustworthinessVerifier selfAttestationTrustworthinessVerifier, @NotNull @NotNull ObjectConverter objectConverter) Constructor for WebAuthnRegistrationManager with custom verifiers and object converter- Parameters:
attestationStatementVerifiers- list of attestation statement verifierscertPathTrustworthinessVerifier- verifier for certification path trustworthinessselfAttestationTrustworthinessVerifier- verifier for self attestation trustworthinessobjectConverter- converter for object serialization/deserialization
-
WebAuthnRegistrationManager
public WebAuthnRegistrationManager(@NotNull @NotNull List<AttestationStatementVerifier> attestationStatementVerifiers, @NotNull @NotNull CertPathTrustworthinessVerifier certPathTrustworthinessVerifier, @NotNull @NotNull SelfAttestationTrustworthinessVerifier selfAttestationTrustworthinessVerifier) Constructor for WebAuthnRegistrationManager with custom verifiers and default object converter- Parameters:
attestationStatementVerifiers- list of attestation statement verifierscertPathTrustworthinessVerifier- verifier for certification path trustworthinessselfAttestationTrustworthinessVerifier- verifier for self attestation trustworthiness
-
-
Method Details
-
createNonStrictWebAuthnRegistrationManager
@NotNull public static @NotNull WebAuthnRegistrationManager createNonStrictWebAuthnRegistrationManager()CreatesWebAuthnRegistrationManagerwith non strict configuration- Returns:
- configured
WebAuthnRegistrationManager
-
createNonStrictWebAuthnRegistrationManager
@NotNull public static @NotNull WebAuthnRegistrationManager createNonStrictWebAuthnRegistrationManager(@NotNull @NotNull ObjectConverter objectConverter) CreatesWebAuthnManagerwith non strict configuration- Parameters:
objectConverter- ObjectConverter- Returns:
- configured
WebAuthnManager
-
parse
Parses a WebAuthn registration response JSON string- Parameters:
registrationResponseJSON- the registration response in JSON format- Returns:
- the parsed registration data
-
parse
@NotNull public @NotNull RegistrationData parse(@NotNull @NotNull InputStream registrationResponseJSON) Parses a WebAuthn registration response JSON from an input stream- Parameters:
registrationResponseJSON- the registration response in JSON format as an input stream- Returns:
- the parsed registration data
-
parse
@NotNull public @NotNull RegistrationData parse(@NotNull @NotNull RegistrationRequest registrationRequest) throws DataConversionException Parses a WebAuthn registration request- Parameters:
registrationRequest- the registration request to parse- Returns:
- the parsed registration data
- Throws:
DataConversionException- if data conversion fails
-
verify
@NotNull public @NotNull RegistrationData verify(@NotNull @NotNull String registrationResponseJSON, @NotNull @NotNull RegistrationParameters registrationParameters) Verifies a WebAuthn registration response JSON string- Parameters:
registrationResponseJSON- the registration response in JSON formatregistrationParameters- the parameters for registration verification- Returns:
- the verified registration data
-
verify
@NotNull public @NotNull RegistrationData verify(@NotNull @NotNull InputStream registrationResponseJSON, @NotNull @NotNull RegistrationParameters registrationParameters) Verifies a WebAuthn registration response JSON from an input stream- Parameters:
registrationResponseJSON- the registration response in JSON format as an input streamregistrationParameters- the parameters for registration verification- Returns:
- the verified registration data
-
verify
@NotNull public @NotNull RegistrationData verify(@NotNull @NotNull RegistrationRequest registrationRequest, @NotNull @NotNull RegistrationParameters registrationParameters) throws DataConversionException, VerificationException Verifies a WebAuthn registration request- Parameters:
registrationRequest- the registration request to verifyregistrationParameters- the parameters for registration verification- Returns:
- the verified registration data
- Throws:
DataConversionException- if data conversion failsVerificationException- if verification fails
-
verify
@NotNull public @NotNull RegistrationData verify(@NotNull @NotNull RegistrationData registrationData, @NotNull @NotNull RegistrationParameters registrationParameters) throws VerificationException Verifies WebAuthn registration data- Parameters:
registrationData- the registration data to verifyregistrationParameters- the parameters for registration verification- Returns:
- the verified registration data
- Throws:
VerificationException- if verification fails
-
getRegistrationDataVerifier
Gets the registration data verifier- Returns:
- the registration data verifier
-