Class PasskeyVerifier.Expectation

java.lang.Object
com.iizix.server.user.passkey.PasskeyVerifier.Expectation
Enclosing class:
PasskeyVerifier

public static final class PasskeyVerifier.Expectation extends Object
What the server expects of a ceremony.
Author:
Christopher Mindus
  • Field Details

    • rpId

      public final String rpId
      The relying party ID of the application.
    • origins

      public final Set<String> origins
      The exact origins a credential may come from, e.g. https://app.example.com.
    • userVerification

      public final boolean userVerification
      Flag for user verification: the UV flag must be set.
    • algorithms

      public final Set<Integer> algorithms
      The COSE algorithms offered to the authenticator.
  • Constructor Details

    • Expectation

      public Expectation(byte[] challenge, String rpId, Set<String> origins, boolean userVerification, Set<Integer> algorithms)
      Creates the expectation.
      Parameters:
      challenge - The challenge the server made, 16 bytes at least.
      rpId - The relying party ID.
      origins - The exact origins accepted. For the relying party ID localhost every origin http://localhost and https://localhost, with any port, is accepted as well.
      userVerification - Flag for user verification required.
      algorithms - The COSE algorithms offered.
      Throws:
      NullPointerException - If a parameter is null.
      IllegalArgumentException - If the challenge is shorter than 16 bytes, or the relying party ID is empty.
  • Method Details

    • isOriginAccepted

      public boolean isOriginAccepted(String origin)
      Checks if an origin is accepted.
      Parameters:
      origin - The origin of the client data.
      Returns:
      true when it is one of the origins, or a localhost origin of the relying party ID localhost.