Package web5.sdk.crypto.keys
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.
-
-
Constructor Summary
Constructors Constructor Description InMemoryKeyManager(List<Jwk> privateJwks)
-
Method Summary
Modifier and Type Method Description JwkimportPrivateJwk(Jwk privateJwk)Imports a private key which may be stored somewhere such as environment variables. SignergetSigner(Jwk publicJwk)Returns the Signer for the given public key. List<Jwk>exportPrivateJwks()-
-
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.
-
exportPrivateJwks
List<Jwk> exportPrivateJwks()
-
-
-
-