Class WebAuthnRegistrationManager

java.lang.Object
com.webauthn4j.WebAuthnRegistrationManager

public class WebAuthnRegistrationManager extends Object
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 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 verifiers
      certPathTrustworthinessVerifier - verifier for certification path trustworthiness
      selfAttestationTrustworthinessVerifier - verifier for self attestation trustworthiness
      customRegistrationVerifiers - list of custom registration verifiers
      objectConverter - 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 verifiers
      certPathTrustworthinessVerifier - verifier for certification path trustworthiness
      selfAttestationTrustworthinessVerifier - verifier for self attestation trustworthiness
      customRegistrationVerifiers - 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 verifiers
      certPathTrustworthinessVerifier - verifier for certification path trustworthiness
      selfAttestationTrustworthinessVerifier - verifier for self attestation trustworthiness
      objectConverter - 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 verifiers
      certPathTrustworthinessVerifier - verifier for certification path trustworthiness
      selfAttestationTrustworthinessVerifier - verifier for self attestation trustworthiness
  • Method Details

    • createNonStrictWebAuthnRegistrationManager

      @NotNull public static @NotNull WebAuthnRegistrationManager createNonStrictWebAuthnRegistrationManager()
      Creates WebAuthnRegistrationManager with non strict configuration
      Returns:
      configured WebAuthnRegistrationManager
    • createNonStrictWebAuthnRegistrationManager

      @NotNull public static @NotNull WebAuthnRegistrationManager createNonStrictWebAuthnRegistrationManager(@NotNull @NotNull ObjectConverter objectConverter)
      Creates WebAuthnManager with non strict configuration
      Parameters:
      objectConverter - ObjectConverter
      Returns:
      configured WebAuthnManager
    • parse

      @NotNull public @NotNull RegistrationData parse(@NotNull @NotNull String registrationResponseJSON)
      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 format
      registrationParameters - 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 stream
      registrationParameters - 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 verify
      registrationParameters - the parameters for registration verification
      Returns:
      the verified registration data
      Throws:
      DataConversionException - if data conversion fails
      VerificationException - 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 verify
      registrationParameters - the parameters for registration verification
      Returns:
      the verified registration data
      Throws:
      VerificationException - if verification fails
    • getRegistrationDataVerifier

      @NotNull public @NotNull RegistrationDataVerifier getRegistrationDataVerifier()
      Gets the registration data verifier
      Returns:
      the registration data verifier