Skip to main content

Function

getEncryptedKey(params)
Fetches the encrypted ciphertext and metadata for a stored wrapped key without decrypting it.

Parameters

params.pkpSessionSigs
SessionSigsMap
required
Session signatures identifying the PKP that owns the wrapped key.
params.litClient
LitClient
required
Lit client instance used to talk to the wrapped-keys service.
params.id
string
required
Identifier of the wrapped key to retrieve.
params.includeVersions
boolean
Optional flag to return the versions array of prior states.
params.userMaxPrice
bigint
Optional price ceiling for the Lit Action.

Returns

result
StoredKeyData
Includes ciphertext, dataToEncryptHash, memo, key type, public key, PKP address, and (when requested) versions + updatedAt.

Example

const storedKey = await wrappedKeysApi.getEncryptedKey({
  pkpSessionSigs,
  litClient,
  id,
  includeVersions: true, // optional
});