From d37e173ee3e84c05467837e491bd9e61927e1be8 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Tue, 10 Feb 2026 00:29:45 +0100 Subject: [PATCH] [BEEEP] Add deprecation notices to encstring encrypt API (#18811) * Add deprecation notices to encstring encrypt API * Cleanup comment * Run prettier --- .../crypto/abstractions/encrypt.service.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/libs/common/src/key-management/crypto/abstractions/encrypt.service.ts b/libs/common/src/key-management/crypto/abstractions/encrypt.service.ts index 87af3852116..03cfd173a4d 100644 --- a/libs/common/src/key-management/crypto/abstractions/encrypt.service.ts +++ b/libs/common/src/key-management/crypto/abstractions/encrypt.service.ts @@ -5,12 +5,20 @@ import { EncString } from "../models/enc-string"; export abstract class EncryptService { /** * Encrypts a string to an EncString + * + * @deprecated NOTE: For new use-cases, prefer using the DataEnvelope inside the SDK instead. This + * is both safer and more maintainable. + * * @param plainValue - The value to encrypt * @param key - The key to encrypt the value with */ abstract encryptString(plainValue: string, key: SymmetricCryptoKey): Promise; /** * Encrypts bytes to an EncString + * + * @deprecated NOTE: You probably do not want to encrypt raw bytes. Please contact the Key-Management team if you think + * you need to. + * * @param plainValue - The value to encrypt * @param key - The key to encrypt the value with * @deprecated Bytes are not the right abstraction to encrypt in. Use e.g. key wrapping or file encryption instead @@ -129,6 +137,9 @@ export abstract class EncryptService { * Encapsulates a symmetric key with an asymmetric public key * Note: This does not establish sender authenticity * @see {@link https://en.wikipedia.org/wiki/Key_encapsulation_mechanism} + * + * @deprecated NOTE: You probably do not want to use this. Please contact the Key-Management team if you think you need to. + * * @param sharedKey - The symmetric key that is to be shared * @param encapsulationKey - The encapsulation key (public key) of the receiver that the key is shared with */