Thanks to Geoff and Jeff for the pointers.

I used an online dumpasn (http://lapo.it/asn1js/)  to check whether
the public key is encoded correctly and it seems to be fine(it
contains two integers).

Any other ideas on what i should look for to solve this would be
greatly appreciated.

thanks,
john

PS. The sequence i posted originally was not accurate, here is the
whole sequence for the public key
308201080282010100B566A0868FCEB4E2EA6CAB21942F1D089E48AA57692AB62C927EABFF1CBD2C724C8B74963C05F1CEB88DC0898301B7C85F727FE6AB907307430F3A4B1809FE706BD1364EF5774E4B75D49E403760FACD47DF743C16FDEDBF0B3EFBF243B5F205677AA4E0E22644113D9D666EC637ADB54E70965B1EC128396F35F99742633AD7E96566B07B977F924E515E2AC33710189E1F9600A905E06E3A0715DE7CE914E053D6223122AA7F675FF2D2E006ECA1D88DCD394CC2B9A68D9D2B49778AF5B9E51EB546FCC1535D5F8C93C38024CA6E58923CA6B0E6021CA3A9A6937511A228A46D8A94CA514986E8686C4BDA096E17BDC4F8FA19B7803413E51085B0E4840BB5020111

std:string pb("308201080282010100B566A0868FCEB4E2EA.....");
CryptoPP::StringSource pubStr(pb, true, new CryptoPP::HexDecoder);
CryptoPP::RSAES_OAEP_SHA_Encryptor pub(pubStr);




On Feb 25, 9:15 am, Jeffrey Walton <[email protected]> wrote:
> Hi John,
>
> Geoff is correct. Perhaps you can run Guttman's dumpasn1 over the key
> to verify you did not make a transcription mistake. 
> Seehttp://www.cs.auckland.ac.nz/~pgut001/.
>
> Jeff
>
> On 2/25/09, john <[email protected]> wrote:
>
>
>
> > i am trying to encrypt using rsa and a string based
> > DEREncodePublicKey.  When i run the code below i get the following
> > error on the encryptor: CryptoPP::BERDecodeErr at memory location.
>
> > string pb("93880B9999427FFFBD189F66CD1D0E165B75…");
> > CryptoPP::StringSource pubStr(pb, true, new CryptoPP::HexDecoder);
> > CryptoPP::RSAES_OAEP_SHA_Encryptor pub(pubStr);
>
> > thanks in advance,
>
> > john
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the "Crypto++ Users" 
Google Group.
To unsubscribe, send an email to [email protected].
More information about Crypto++ and this group is available at 
http://www.cryptopp.com.
-~----------~----~----~----~------~----~------~--~---

Reply via email to