The encryption algorithm indicates the type of algorithm to use for decrypting the specified encrypted content. Possible values for assymetric keys include: RSA1_5, RSA_OAEP and RSA_OAEP_256. Possible values for symmetric keys include: A128CBC, A128CBC-HS256, A192CBC, A192CBC-HS384, A256CBC and A256CBC-HS512
Code Samples
Encrypts the content. Subscribes to the call asynchronously and prints out the encrypted content details when a response has been received.
byte[] plainTextToEncrypt = new byte[100]; new Random(0x1234567L).nextBytes(plainTextToEncrypt); EncryptResult encryptionResult = cryptographyClient.encrypt(EncryptionAlgorithm.RSA_OAEP, plainTextToEncrypt, new Context(key1, value1)); System.out.printf("Received encrypted content of length %d with algorithm %s \n", encryptionResult.getCipherText().length, encryptionResult.getAlgorithm().toString());