Show / Hide Table of Contents

Decrypt Method

Decrypt(byte[], int, int)

Returns the AES-256-CBC decryption of ciphertext using an IV specified by the protocol and the EncryptionKey. With protocol 1 the IV is all 00 bytes. With protocol 2, it is the first block size bytes of ciphertext.

C#
public abstract byte[] Decrypt(byte[] ciphertext, int offset, int length)

Parameters

Type Name Description
byte[] ciphertext

The data to decrypt.

int offset

The offset in ciphertext where the method will begin decrypting.

int length

The number of bytes to decrypt.

Returns

byte[]

A new byte array containing the decrypted data.

Exceptions

Type Condition
ArgumentNullException

The ciphertext argument is null.

InvalidOperationException

The object has been created or initialized, but the Encapsulate(CoseKey) method has not been called.

ArgumentException

The length of the ciphertext is not a multiple of the AES block size (16 bytes).

Remarks

Note that this method will verify that the input buffer, offset, and length are valid.

In this article
Back to top Generated by DocFX