Class ECVerifier

java.lang.Object
io.fusionauth.jwt.ec.ECVerifier
All Implemented Interfaces:
Verifier

public class ECVerifier extends Object implements Verifier
Author:
Daniel DeGroff
  • Method Details

    • newVerifier

      public static ECVerifier newVerifier(String publicKey)
      Return a new instance of the EC Verifier with the provided public key.
      Parameters:
      publicKey - The EC public key PEM.
      Returns:
      a new instance of the EC verifier.
    • newVerifier

      public static ECVerifier newVerifier(PublicKey publicKey)
      Return a new instance of the EC Verifier with the provided public key.
      Parameters:
      publicKey - The EC public key object.
      Returns:
      a new instance of the EC verifier.
    • newVerifier

      public static ECVerifier newVerifier(Path path)
      Return a new instance of the EC Verifier with the provided public key.
      Parameters:
      path - The path to the EC public key PEM.
      Returns:
      a new instance of the EC verifier.
    • newVerifier

      public static ECVerifier newVerifier(byte[] bytes)
      Return a new instance of the EC Verifier with the provided public key.
      Parameters:
      bytes - The bytes of the EC public key PEM.
      Returns:
      a new instance of the EC verifier.
    • newVerifier

      public static ECVerifier newVerifier(String publicKey, CryptoProvider cryptoProvider)
      Return a new instance of the EC Verifier with the provided public key.
      Parameters:
      publicKey - The EC public key PEM.
      cryptoProvider - The crypto provider used to get the ECDSA Signature algorithm.
      Returns:
      a new instance of the EC verifier.
    • newVerifier

      public static ECVerifier newVerifier(PublicKey publicKey, CryptoProvider cryptoProvider)
      Return a new instance of the EC Verifier with the provided public key.
      Parameters:
      publicKey - The EC public key object.
      cryptoProvider - The crypto provider used to get the ECDSA Signature algorithm.
      Returns:
      a new instance of the EC verifier.
    • newVerifier

      public static ECVerifier newVerifier(Path path, CryptoProvider cryptoProvider)
      Return a new instance of the EC Verifier with the provided public key.
      Parameters:
      path - The path to the EC public key PEM.
      cryptoProvider - The crypto provider used to get the ECDSA Signature algorithm.
      Returns:
      a new instance of the EC verifier.
    • newVerifier

      public static ECVerifier newVerifier(byte[] bytes, CryptoProvider cryptoProvider)
      Return a new instance of the EC Verifier with the provided public key.
      Parameters:
      bytes - The bytes of the EC public key PEM.
      cryptoProvider - The crypto provider used to get the ECDSA Signature algorithm.
      Returns:
      a new instance of the EC verifier.
    • canVerify

      public boolean canVerify(Algorithm algorithm)
      Specified by:
      canVerify in interface Verifier
      Parameters:
      algorithm - The algorithm required to verify the signature on this JWT.
      Returns:
      True if this Verifier is able to verify a signature using the specified algorithm.
    • verify

      public void verify(Algorithm algorithm, byte[] message, byte[] signature)
      Description copied from interface: Verifier
      Verify the signature of the encoded JWT payload.
      Specified by:
      verify in interface Verifier
      Parameters:
      algorithm - The algorithm used to verify the JWT signature.
      message - The JWT message. The header and claims, the first two segments of the dot separated JWT.
      signature - The signature to verify.