Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/rulvar / DataKeyProvider

Interface: DataKeyProvider ​

Defined in: packages/core/dist/index.d.ts

The KMS seam. keyId is a stable routing id stamped into every envelope (a KMS key ARN or alias, or a local rotation label); the two methods are the exact shape of KMS GenerateDataKey and Decrypt. Both are called only inside createEnvelopeEncryption.

Properties ​

PropertyModifierTypeDefined in
keyIdreadonlystringpackages/core/dist/index.d.ts

Methods ​

generateDataKey() ​

ts
generateDataKey(): Promise<{
  plaintext: Bytes;
  wrapped: Bytes;
}>;

Defined in: packages/core/dist/index.d.ts

Returns ​

Promise<{ plaintext: Bytes; wrapped: Bytes; }>


unwrapDataKey() ​

ts
unwrapDataKey(wrapped): Promise<Bytes>;

Defined in: packages/core/dist/index.d.ts

Parameters ​

ParameterType
wrappedBytes

Returns ​

Promise&lt;Bytes&gt;