Interface KeyProvider<U extends PublicKey,R extends PrivateKey>

Type Parameters:
U - the class that represents the Public Key
R - the class that represents the Private Key
All Known Subinterfaces:
ECDSAKeyProvider, RSAKeyProvider

interface KeyProvider<U extends PublicKey,R extends PrivateKey>
Generic Public/Private Key provider.
  • Method Summary

    Modifier and Type
    Method
    Description
    Getter for the Private Key instance.
    Getter for the Id of the Private Key used to sign the tokens.
    Getter for the Public Key instance with the given Id.
  • Method Details

    • getPublicKeyById

      U getPublicKeyById(String keyId)
      Getter for the Public Key instance with the given Id. Used to verify the signature on the JWT verification stage.
      Parameters:
      keyId - the Key Id specified in the Token's Header or null if none is available. Provides a hint on which Public Key to use to verify the token's signature.
      Returns:
      the Public Key instance
    • getPrivateKey

      R getPrivateKey()
      Getter for the Private Key instance. Used to sign the content on the JWT signing stage.
      Returns:
      the Private Key instance
    • getPrivateKeyId

      String getPrivateKeyId()
      Getter for the Id of the Private Key used to sign the tokens. This represents the `kid` claim and will be placed in the Header.
      Returns:
      the Key Id that identifies the Private Key or null if it's not specified.