Class InMemoryJWKStore

java.lang.Object
io.inverno.mod.security.jose.jwk.InMemoryJWKStore
All Implemented Interfaces:
JWKStore

public class InMemoryJWKStore extends Object implements JWKStore

A JWKStore implementation that stores and read JWK from concurrent maps in memory.

Since:
1.5
Author:
Jeremy Kuhn
  • Constructor Details

    • InMemoryJWKStore

      public InMemoryJWKStore()
  • Method Details

    • getByKeyId

      public <T extends JWK> Mono<T> getByKeyId(String kid) throws JWKStoreException
      Description copied from interface: JWKStore

      Returns the key stored for the specified key id.

      Specified by:
      getByKeyId in interface JWKStore
      Type Parameters:
      T - the expected type of the key
      Parameters:
      kid - a key id
      Returns:
      a single key publisher or an empty publisher
      Throws:
      JWKStoreException - if there was an error accessing the store
    • getBy509CertificateSHA1Thumbprint

      public <T extends JWK> Mono<T> getBy509CertificateSHA1Thumbprint(String x5t) throws JWKStoreException
      Description copied from interface: JWKStore

      Returns the key stored for the specified X.509 SHA1 thumbprint

      Specified by:
      getBy509CertificateSHA1Thumbprint in interface JWKStore
      Type Parameters:
      T - the expected type of the key
      Parameters:
      x5t - an X.509 SHA1 thumbprint
      Returns:
      a single key publisher or an empty publisher
      Throws:
      JWKStoreException - if there was an error accessing the store
    • getByX509CertificateSHA256Thumbprint

      public <T extends JWK> Mono<T> getByX509CertificateSHA256Thumbprint(String x5t_S256) throws JWKStoreException
      Description copied from interface: JWKStore

      Returns the key stored for the specified X.509 SHA256 thumbprint

      Specified by:
      getByX509CertificateSHA256Thumbprint in interface JWKStore
      Type Parameters:
      T - the expected type of the key
      Parameters:
      x5t_S256 - an X.509 SHA256 thumbprint
      Returns:
      a single key publisher or an empty publisher
      Throws:
      JWKStoreException - if there was an error accessing the store
    • getByJWKThumbprint

      public <T extends JWK> Mono<T> getByJWKThumbprint(String thumbprint) throws JWKStoreException
      Description copied from interface: JWKStore

      Returns the key stored for the specified JWK thumbprint.

      Specified by:
      getByJWKThumbprint in interface JWKStore
      Type Parameters:
      T - the expected type of the key
      Parameters:
      thumbprint - a JWK thumbprint
      Returns:
      a single key publisher or an empty publisher
      Throws:
      JWKStoreException - if there was an error accessing the store
    • set

      public Mono<Void> set(JWK jwk) throws JWKStoreException
      Description copied from interface: JWKStore

      Stores the specified key into the store.

      This method should store the key for all available identifiers: key id, X.509 SHA1 thumbprint, X.509 SHA256 thumbprint and JWK thumbprint.

      Specified by:
      set in interface JWKStore
      Parameters:
      jwk - the key to store
      Returns:
      a single empty publisher that completes once the key has been stored
      Throws:
      JWKStoreException - if there was an error accessing the store
    • remove

      public Mono<Void> remove(JWK jwk) throws JWKStoreException
      Description copied from interface: JWKStore

      Removes the specified key from the store.

      This method should remove the key associated to all available identifiers: key id, X.509 SHA1 thumbprint, X.509 SHA256 thumbprint and JWK thumbprint.

      Specified by:
      remove in interface JWKStore
      Parameters:
      jwk - the key to remove
      Returns:
      a single empty publisher that completes once the key has been removed
      Throws:
      JWKStoreException - if there was an error accessing the store