Interface KeyManagementService

Defines the interface of the KMS interface

Hierarchy

  • KeyManagementService

Properties

close: (() => Promise<void>)

Type declaration

    • (): Promise<void>
    • Close and release resources

      Returns Promise<void>

      Promise resolving and return nothing

decrypt: ((decryptOptions) => Promise<Uint8Array>)

Type declaration

    • (decryptOptions): Promise<Uint8Array>
    • Takes in the necessary data to be decrypted

      Parameters

      • decryptOptions: EncryptionOptions

      Returns Promise<Uint8Array>

      unencoded plaintext data

deleteKey: ((keyId) => Promise<undefined | KeyInfo>)

Type declaration

    • (keyId): Promise<undefined | KeyInfo>
    • Deletes a key by keyId

      Parameters

      • keyId: string

      Returns Promise<undefined | KeyInfo>

      a KeyInfo object of the KeyId if found

deriveKey: ((deriveKeyOptions) => Promise<KeyInfo>)

Type declaration

    • (deriveKeyOptions): Promise<KeyInfo>
    • Derives a key and stores it in the KMS

      Parameters

      • deriveKeyOptions: DeriveKeyOptions

      Returns Promise<KeyInfo>

      A keyInfo object of the key stored in the KMS

digest: ((algorithm, data) => Promise<Uint8Array>)

Type declaration

    • (algorithm, data): Promise<Uint8Array>
    • Generates a hash digest of the data

      Parameters

      • algorithm: DigestAlgorithm
      • data: Uint8Array

      Returns Promise<Uint8Array>

      a hash digest

encrypt: ((encryptOptions) => Promise<EncryptionResult>)

Type declaration

    • (encryptOptions): Promise<EncryptionResult>
    • Takes in the necessary data to encrypt

      Parameters

      • encryptOptions: EncryptionOptions

      Returns Promise<EncryptionResult>

      unencoded ciphertext data

exportKey: ((keyId) => Promise<undefined | Uint8Array>)

Type declaration

    • (keyId): Promise<undefined | Uint8Array>
    • Parameters

      • keyId: string

      Returns Promise<undefined | Uint8Array>

      a RAW secret, if key exists. If key isn't extractable, throws Error

generateKey: ((generateKeyOptions) => Promise<KeyInfo>)

Type declaration

    • (generateKeyOptions): Promise<KeyInfo>
    • Generates a key and stores it in the KMS

      Parameters

      • generateKeyOptions: GenerateKeyOptions

      Returns Promise<KeyInfo>

      a reference id to a newly generated key that's store in the KMS

generateRandom: ((size) => Promise<Uint8Array>)

Type declaration

    • (size): Promise<Uint8Array>
    • Generates an array of random bytes using a Cryptographically Secure Pseudo Random Number Generator (CSPRNG)

      Parameters

      • size: number

      Returns Promise<Uint8Array>

      an array of pseudo random bytes

getKeyInfo: ((keyId) => Promise<undefined | KeyInfo>)

Type declaration

    • (keyId): Promise<undefined | KeyInfo>
    • Defines the parameters for getKeyInfo function interface into an object type

      Parameters

      • keyId: string

        The identifier of the key

      Returns Promise<undefined | KeyInfo>

      a KeyInfo object of the KeyId

sign: ((signOptions) => Promise<Uint8Array>)

Type declaration

    • (signOptions): Promise<Uint8Array>
    • Signs a message provided as input

      Parameters

      • signOptions: SignOptions

      Returns Promise<Uint8Array>

      signature of the data

unWrapKey: ((UnWrapKeyOptions) => Promise<KeyInfo>)

Type declaration

    • (UnWrapKeyOptions): Promise<KeyInfo>
    • Un-wraps a key and stores it in the KMS

      Parameters

      • UnWrapKeyOptions: UnWrapKeyOptions

      Returns Promise<KeyInfo>

      Key info of the un-wrapped key

verify: ((verifyOptions) => Promise<boolean>)

Type declaration

    • (verifyOptions): Promise<boolean>
    • Verifies a signature

      Parameters

      • verifyOptions: VerifyOptions

      Returns Promise<boolean>

      true if the signature is valid else false

wrapKey: ((WrapKeyOptions) => Promise<EncryptionResult>)

Type declaration

    • (WrapKeyOptions): Promise<EncryptionResult>
    • Wraps a key and returns it

      Parameters

      • WrapKeyOptions: WrapKeyOptions

      Returns Promise<EncryptionResult>

      unencoded ciphertext data

Generated using TypeDoc