Calculating the size of the ciphertext header for a versioned key
To calculate the size of the ciphertext header
Call the I_C_GetCiphertextHeaderLength
API to determine the ciphertext header length for encrypted data. The ciphertext header indicates whether a versioned key was used, and, if so, contains the version number. The header is 3-byte long. Knowing the header length is helpful if you want to decrypt this ciphertext using a mechanism that doesn’t recognize versioned keys - and therefore are not able to use the ciphertext header. (Of course, you need the right key bytes to decrypt.)
Example
rc = I_C_GetCiphertextHeaderLength(sess, cipherspec, encdata, outdatalen,&cipherTextLen);