I am receiving an encrypted file and it's key from a partner. The Key has itself been encrypted using our Digital Certificate Public Key.
When I attempt to decrypt the key using the following and our private key, I get a padding error as shown below:
C:\openssl rsautl -decrypt -in xxxx_Key -inkey xxxxprivatekey.pem -hexdump -out aeskey.txt Loading 'screen' into random state - done RSA operation error 5612:error:0407109F:rsa routines:RSA_padding_check_PKCS1_type_2:pkcs decoding er ror:.\crypto\rsa\rsa_pk1.c:273: 5612:error:04065072:rsa routines:RSA_EAY_PRIVATE_DECRYPT:padding check failed:.\ crypto\rsa\rsa_eay.c:602:
If I add the -Raw switch to the decrypt, it appears to work but the resulting hexdump of the key is WAY larger than I'm expecting - 512 characters in fact. Can anyone offer advice as to what may be going on here? Thanks!