Crypto Lib
    Preparing search index...

    Function decryptWithVersion

    • Decrypt ciphertext by looking up the key version in the ring.

      Parameters

      • ring: KeyRing

        The key ring to search for the decryption key.

      • ciphertext: string

        Base64-encoded ciphertext from encryptWithVersion.

      • version: string

        The key version that was used to encrypt.

      Returns string

      The decrypted plaintext string.

      const plaintext = decryptWithVersion(ring, ciphertext, "v1");
      

      If the version is not found in the ring.