On Mon, May 15, 2006 at 09:30:39AM -0700, Sudharsan Rangarajan wrote:

> Hi Marek,
> I dont really need to care about the private key. I need to know the
> format of the public key of DNSSec, cause i am gonna use openSSL to
> verify the SIG records signed using a KEY record.

>From the rsa(1) manpage:

   openssl rsa [-inform PEM|NET|DER] [-outform PEM|NET|DER] [-in filename]
   [-passin arg] [-out filename] [-passout arg] [-sgckey] [-des] [-des3]
   [-idea] [-text] [-noout] [-modulus] [-check] [-pubin] [-pubout]
   [-engine id]

So, OpenSSL supports one of three formats "PEM" (default), "NET" and "DER".
Try each one and see if any work.

    KEY=/some/file/name.ext
    for form in PEM NET DER
    do
        openssl rsa -inform $form -pubin -in $KEY -noout -text 2>&1 |
            grep modulus: >/dev/null && echo "$form public key"
        openssl rsa -inform $form -in $KEY -noout -text 2>&1 |
            grep modulus: >/dev/null && echo "$form private key"
    done

When I run this on a PEM formatted private key file I get:

    PEM private key

-- 
        Viktor.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to