On Mon, Nov 04, 2002, Hellan,Kim KHE wrote: > In MS .NET, an RSA key can be saved to an XML file like this: > > <RSAKeyValue> > <Modulus>7M85MCazFZv2ro3mqje85mEsh6mb.....</Modulus> > <Exponent>AQAB</Exponent> > <P>M85MCazFZv......</P> > <snip> > > I have no problem in creating such an XML format from an OpenSSL RSA* structure. > But how do I create an RSA* from this XML? > > I can easily load the XML, strip the Base64 encoding and end up with some byte >bufferes containing modulus, exponent, primes etc, but how do I assign these buffers >to a valid OpenSSL RSA* structure. >
Convert the byte arrays to big endian format (if needed) call RSA_new() and assign each component using: rsa->n = BN_bin2bn(s, len, NULL); Steve. -- Dr. Stephen Henson [EMAIL PROTECTED] OpenSSL Project http://www.openssl.org/~steve/ ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List [EMAIL PROTECTED] Automated List Manager [EMAIL PROTECTED]