CipherStashDocs
StackLatestPackagesStackSrcEncryptionClasses

DecryptOperation

Decrypts an encrypted payload using the provided client. This is the type returned by the decrypt method of the EncryptionClient.

@cipherstash/stack


Class: DecryptOperation

Defined in: packages/stack/src/encryption/operations/decrypt.ts:18

Decrypts an encrypted payload using the provided client. This is the type returned by the decrypt method of the EncryptionClient.

Extends

  • EncryptionOperation<JsPlaintext>

Constructors

Constructor

new DecryptOperation(client, encryptedData): DecryptOperation;

Defined in: packages/stack/src/encryption/operations/decrypt.ts:26

Parameters

client

Client

encryptedData

Encrypted | null

Returns

DecryptOperation

Overrides

EncryptionOperation&lt;JsPlaintext&gt;.constructor

Methods

audit()

audit(config): this;

Defined in: packages/stack/src/encryption/operations/base-operation.ts:20

Attach audit metadata to this operation. Can be chained.

Parameters

config

AuditConfig

Configuration for ZeroKMS audit logging

Returns

this

Inherited from

EncryptionOperation.audit

getAuditData()

getAuditData(): AuditData;

Defined in: packages/stack/src/encryption/operations/base-operation.ts:28

Get the audit data for this operation.

Returns

AuditData

Inherited from

EncryptionOperation.getAuditData

then()

then&lt;TResult1, TResult2&gt;(onfulfilled?, onrejected?): Promise&lt;TResult1 | TResult2&gt;;

Defined in: packages/stack/src/encryption/operations/base-operation.ts:42

Make the operation thenable

Type Parameters

TResult1

TResult1 = Result<JsPlaintext, EncryptionError>

TResult2

TResult2 = never

Parameters

onfulfilled?

(value) => TResult1 | PromiseLike<TResult1> | null

onrejected?

(reason) => TResult2 | PromiseLike<TResult2> | null

Returns

Promise<TResult1 | TResult2>

Inherited from

EncryptionOperation.then

withLockContext()

withLockContext(lockContext): DecryptOperationWithLockContext;

Defined in: packages/stack/src/encryption/operations/decrypt.ts:32

Parameters

lockContext

LockContext

Returns

DecryptOperationWithLockContext


execute()

execute(): Promise&lt;Result&lt;JsPlaintext, EncryptionError&gt;>;

Defined in: packages/stack/src/encryption/operations/decrypt.ts:38

Execute the operation and return a Result

Returns

Promise<Result<JsPlaintext, EncryptionError>>

Overrides

EncryptionOperation.execute

getOperation()

getOperation(): {
  client: Client;
  encryptedData: Encrypted | null;
  auditData?: Record&lt;string, unknown&gt;;
};

Defined in: packages/stack/src/encryption/operations/decrypt.ts:76

Returns

{
  client: Client;
  encryptedData: Encrypted | null;
  auditData?: Record&lt;string, unknown&gt;;
}
client
client: Client;
encryptedData
encryptedData: Encrypted | null;
auditData?
optional auditData: Record&lt;string, unknown&gt;;

On this page