Hi

I am trying to do encrypt/decrypt on a pub/pvt key pair. Here is the code snippet which I am using,

 

 

            char privKey[] = "3081E70201003081C906072A8648CE3804013081BD02510"

        "084CA34301AB2EC920DE1304BF4467258D5371869FF9710D541790376D615B57B9CDB89A5"

        "7D9511DCAB6AF2A068DE8C1F9D92752B7BAEE2F3CD50D0CA6B1809F46CF3E2D5C4786A110"

        "9A40DB6929A5B85021500EDFFB2725C9F7C688E1DE003E70B87F9E67C115902510081D65A"

        "CBD4C406FEEB4EACBF8CBEBE4A4AAB911D65BEC76A0DB254FBF5D77F42A0EE39C2E75FAC3"

        "5C78B74ADD0C306471AAC93B9CB9EAB392C773E4E3596D74A31372B2E861EFD8603EA5CC5"

        "6A315A120416021441A76580783FE328E58753C4880D0FD00A12514D";

 

StringSource privFile(privKey, true, new HexDecoder);

                        RSAES_OAEP_SHA_Decryptor rsaPriv;

                        rsaPriv.AccessKey().BERDecodeKey(privFile);

 

But when I run the above code, I am getting BER encoding exception error. So I tried to remove the privKey with rsa400pv.dat file, but I am still getting the same exception.

StringSource privFile(rsa400pv.dat, true, new HexDecoder);

What am I doing wrong? Please help

 

Thanks
Seshu

 

 

Reply via email to