At 12:34 PM 12/10/2002 -0500, you wrote:
ArraySink PrivateNullSink(0, 0);
RSAES_OAEP_SHA_Decryptor pri(RngPoolSingleton::Instance()->GetRandomPool(), CTF_PKCS_KEY_LEN);
HexEncoder priString(&PrivateNullSink);
pri.DEREncode(priString);
priString.MessageEnd();
unsigned int PrivateLen = PrivateNullSink.TotalPutLength();
apCtfKeyPair->_Private.Alloc(PrivateLen);
HexEncoder PriHex(new ArraySink(apCtfKeyPair->_Private.Begin(), PrivateLen));
pri.DEREncode(PriHex);
PriHex.MessageEnd();
The HexEncoder is trying to delete the PrivateNullSink here and throwing fits. What's wrong?
At 08:12 PM 12/9/2002 -0500, you wrote:
First DEREncode into an ArraySink with a 0-size buffer. Then call
TotalPutLength() on the ArraySink to get the size. Then DEREncode again
into a new ArraySink with a buffer of that size.
On Mon, Dec 09, 2002 at 05:09:39PM -0500, Matthew Cross wrote:
> I want to use an ArraySink instead of a StringSink for the destination of
> my Public/Private
> Key generation. I believe I have to pre-allocate my array for the
> destination so my question is
> how do I know the size of the DER encoded output for any given size
> key? Or is there a way
> to make ArraySink allocate for me?
>
> Matt
