> The following code generates an error: > > string output; > Base32Encoder encoder(new StringSink(output)); > > privatekey.GetPrivateExponent().DEREncode(encoder);
Add "encoder.MessageEnd();" here. Base32Encoder buffers its input in order to encode 5 bytes at a time into 8 bytes, and MessageEnd() tells it that no more bytes are coming and to encode what's left in the buffer. > Integer x; > StringSource decoder(output, true, new Base32Decoder()); In case you're wondering, MessageEnd() is not needed here because StringSource calls it for you. > x.BERDecode(decoder); --~--~---------~--~----~------------~-------~--~----~ 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. -~----------~----~----~----~------~----~------~--~---