Class InMemoryKeyManager

  • All Implemented Interfaces:
    web5.sdk.crypto.keys.KeyExporter , web5.sdk.crypto.keys.KeyManager

    
    public final class InMemoryKeyManager
     implements KeyManager, KeyExporter
                        

    A class for managing cryptographic keys in-memory.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      Jwk importPrivateJwk(Jwk privateJwk) Imports a private key which may be stored somewhere such as environment variables.
      Signer getSigner(Jwk publicJwk) Returns the Signer for the given public key.
      List<Jwk> exportPrivateJwks()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • InMemoryKeyManager

        InMemoryKeyManager(List<Jwk> privateJwks)
        Parameters:
        privateJwks - A list of private keys represented as JWKs (JSON Web Keys).
    • Method Detail

      • importPrivateJwk

         Jwk importPrivateJwk(Jwk privateJwk)

        Imports a private key which may be stored somewhere such as environment variables.

        Parameters:
        privateJwk - The private key represented as a JWK.
        Returns:

        Jwk The public key represented as a JWK.

      • getSigner

         Signer getSigner(Jwk publicJwk)

        Returns the Signer for the given public key.

        Parameters:
        publicJwk - The public key represented as a JWK.
        Returns:

        Signer The signer for the given public key.