On Mon, Dec 24, 2012 at 1:54 AM, Tayade, Nilesh <nilesh.tay...@netscout.com> wrote: >> -----Original Message----- >> From: owner-openssl-us...@openssl.org [mailto:owner-openssl- >> us...@openssl.org] On Behalf Of Jeffrey Walton >> Sent: Monday, December 24, 2012 11:25 AM >> To: openssl-users@openssl.org >> Subject: Re: RSA_private_decrypt function takes longer time. > [...] > >> >> On 12/21/2012 1:13 PM, Tayade, Nilesh wrote: >> >> <SNIP> >> > >> > Is the conversion supported by openssl utility (e.g. the way we >> convert .PEM to PKCS8 format >> > openssl pkcs8 -topk8 -in <PEM file> -out <PKCS8 format file>)? Does >> openssl support PEM to CRT conversion? >> > I did not get any direct command for this conversion. >> I believe you also need -inform and -outform. For example: >> >> $ openssl genrsa -out rsa-openssl.pem 3072 >> $ openssl pkcs8 -nocrypt -in rsa-openssl.pem -inform PEM -topk8 >> -outform DER -out rsa-openssl.der >> >> Folks like Jakob or David likely have a one liner. My notes are kind >> of old, and this always worked for me. >> >> Here's the syntax for X.509 in case you need it: >> >> $ openssl genrsa -out rsa-openssl.pem 3072 >> $ openssl rsa -in rsa-openssl.pem -pubout -outform DER -out rsa- >> openssl.der > > Sorry to contact you in person. Just to confirm, do you mean .der format is > same as Chinese remainder format of private key? No problem. Taking it public again ;)
Note sure. The format we use is described in PKCS #1 (IIRC). What you are referring to - CRT and dP, dQ, pInv, and qInv - are the private key Representation 2 from Section 3.2 RSA Private Key (ftp://ftp.rsasecurity.com/pub/pkcs/pkcs-1/pkcs-1v2-1.pdf). But I would not expect it to be available. Once you have a RSA Private Key, use `dumpasn1` and you will know for sure. `openssl asn1parse` will also do it, but I use Gutmann's utility. If its not representation two, then see "RSA CRT key?", https://groups.google.com/d/msg/sci.crypt/0ijgmfeBZOM/1h5NC9-7ZRsJ and "RSA Converter", http://rsaconverter.sourceforge.net. Jeff ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org