import { EncryptionAlgorithmSpec } from '@aws-sdk/client-kms'; /** * Represents a Crypto class that provides encryption and decryption functionality using AWS KMS. */ export default class Crypto { /** * The KMSClient instance used for making requests to the Key Management Service (KMS). */ private readonly client; /** * The AWS region of the object. This property is readonly and cannot be modified once set. */ private readonly region; /** * The unique identifier for the KMS. * @readonly * @type {string} */ private readonly keyId; /** * Specifies the encryption algorithm used for encryption. */ private readonly encryptionAlgorithm; /** * Constructs a new instance of a KeyManager with the provided region, keyId, and optional encryption algorithm. * @param {string} region - The region where the key is stored. * @param {string} keyId - The ID of the key. * @param {EncryptionAlgorithmSpec} [optEncryptionAlgorithm='RSAES_OAEP_SHA_256'] - The encryption algorithm to use (default is RSAES_OAEP_SHA_256). * @returns None */ constructor(region: string, keyId: string, optEncryptionAlgorithm?: EncryptionAlgorithmSpec); /** * Encrypts the given data using RSAES_OAEP_SHA_256 encryption algorithm. * @param {string | any} data - The data to be encrypted. * @returns {Promise} - A promise that resolves to the encrypted data as a hexadecimal string. */ encryptData(data: string | any): Promise; /** * Decrypts the given data using the RSAES_OAEP_SHA_256 encryption algorithm. * @param {string} data - The encrypted data to decrypt. * @returns {Promise} - A promise that resolves to the decrypted plaintext string. * If decryption fails, null is returned. */ decryptData(data: string): Promise; }