Member Junction
    Preparing search index...

    AWS KMS key source provider.

    Retrieves encryption keys from AWS Key Management Service. The key material is stored encrypted in KMS and decrypted on retrieval.

    • Key material never leaves AWS in plaintext until decryption
    • All operations are logged in CloudTrail
    • IAM policies control access to keys
    • Supports key rotation managed by AWS
    // In database: KeyLookupValue = 'alias/mj-encryption-key'
    // The provider will call KMS to decrypt the data key

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Configuration passed during instantiation. Contains lookupValue and any source-specific additional config.

    Accessors

    Methods

    • Retrieves encryption key material from AWS KMS.

      This method expects the lookupValue to contain a base64-encoded encrypted data key (ciphertext blob) that was encrypted using a KMS customer master key (CMK).

      For envelope encryption pattern:

      1. Generate a data key using KMS GenerateDataKey
      2. Store the encrypted data key (CiphertextBlob) as base64 in lookupValue
      3. This method decrypts it to get the plaintext key

      Parameters

      • lookupValue: string

        Base64-encoded encrypted data key

      • Optional_keyVersion: string

        Not used for KMS (versioning handled by KMS)

      Returns Promise<Buffer>

      Buffer containing the decrypted key material

      Error if the key cannot be decrypted

    • Checks if a key exists in AWS KMS.

      Note: This only checks if the key ARN/alias format is valid. Actual key existence is verified on GetKey().

      Parameters

      • lookupValue: string

        The KMS key ARN or alias

      Returns Promise<boolean>

      true if the lookup value appears to be a valid KMS key reference