You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The DecryptBuffer method on the protection handler expects the following parameters
offsetFromStart: Relative position of inputBuffer from the very beginning of the encrypted content
inputBuffer: Buffer of encrypted content that will be decrypted
inputBufferSize: Size (in bytes) of input buffer
outputBuffer: Buffer into which decrypted content will be copied
outputBufferSize: Size (in bytes) of output buffer
isFinal: If input buffer contains the final encrypted bytes or not
=> Returns: Actual size (in bytes) of decrypted content
How could you estimate the size of the decrypted content buffer for the outputBufferSize/outputBufferSize ?
In your example, the variable bufferSize was known as per the encryption example (size of the string to encrypt)...In real cases, we wouldn't know that information upfront.
byte[] decryptedBuffer = new byte[bufferSize];
var bytesDecrypted = consumptionHandler.DecryptBuffer(0, encryptedTextBuffer, decryptedBuffer, true);
I see a GetProtectedContentLength but no correspondence for a GetUnProtectedContentLength.
Let me know.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
ID: 625e09a4-3fcf-57c9-c62c-5aea6c8e9d86
Version Independent ID: 7151e733-3b59-a817-8cef-a5dfc3a2ddd2
Hi All,
The DecryptBuffer method on the protection handler expects the following parameters
=> Returns: Actual size (in bytes) of decrypted content
How could you estimate the size of the decrypted content buffer for the outputBufferSize/outputBufferSize ?
In your example, the variable bufferSize was known as per the encryption example (size of the string to encrypt)...In real cases, we wouldn't know that information upfront.
byte[] decryptedBuffer = new byte[bufferSize];
var bytesDecrypted = consumptionHandler.DecryptBuffer(0, encryptedTextBuffer, decryptedBuffer, true);
I see a GetProtectedContentLength but no correspondence for a GetUnProtectedContentLength.
Let me know.
Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: