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
