fn unpad_key(key_bytes: &[u8]) -> Result<&[u8], CryptoError>Expand description
Unpad a key that is padded using the PKCS7-like padding defined by pad_key. The last N bytes of the padded bytes all have the value N. For example, padded to size 4, the value 0,0 becomes 0,0,2,2.
COSE-serialized keys must be distinguishable from SymmetricCryptoKey::Aes256CbcHmacKey keys when encoded as byte arrays with no additional content format. Padding ensures that the byte representation uniquely separates keys by size. The previous key types SymmetricCryptoKey::Aes256CbcHmacKey and SymmetricCryptoKey::Aes256CbcKey are 64 and 32 bytes long respectively.