Re: Add Private Keys in System Store MY

From: Michel Gallant (neutron_at_istar.ca)
Date: 10/19/05


Date: Wed, 19 Oct 2005 12:41:35 -0400

Always the details .... :-)
The utility PvkConvert handles PrivateKeyInfo format which is an UNENCRYPTED
private key. It also expects a binary format (not the B64 format).

So to get that unencrypted form from openssl you can use the nocrypt and outform switches; e.g.:

  openssl pkcs8 -in server.key -topk8 -nocrypt -outform DER -out enc8key.pem

Also, you should update your JVM to 1.4.2 (not sure if 1.2.4 Sun JVM supports PKCS#8 )

- Mitch

  "sunit" <sunit@newsgroup.nospam> wrote in message news:eRyCxCL1FHA.3864@TK2MSFTNGP12.phx.gbl...

    ["Michel Gallant"]
    thanx a lot for taking pain to solve my problem
    Sorry to annoy u once again.

    I converted my private keys from Traditional SSLeay RSAPrivateKey format" to PKCS#8

    openssl>pkcs8 -in server.key -topk8 -out private.key
     i followed the same procedure to execute the program.But it gave the same error

    C:\jdk1.2.4\bin\javac PvkConvert.java
    C:\jdk1.2.4\bin\java PvkConvert private.key

    output shown on my screen is :-
     keyspec 1
    java.security.spec.InvalidKeySpecException: Unknown key spec.
    KeySize: 0 bits

    java.lang.NullPointerException

    and my private keys are store in private.key(pkcs#8).The content of this file is:
    ----BEGIN ENCRYPTED PRIVATE KEY-----
    MIICoTAbBgkqhkiG9w0BBQMwDgQI2ep5W6w4Kt8CAggABIICgJgVeg+JFOGfRorc
    LpNhYLZxrlDzkwHHRH2ABWIuPq44vcBYnz+NNt30zOuaE1+cMnnhFPO7MX4clLrI
    cZLUGHbjJRd4JG0ijjOziXtvO5O9f7Owr0vOsIIALcAEH1dgbnjYwZEbIiBck3oZ
    yCAgeS1gP92qmK8lSbW9UNLvlOpn06NNnmanuyB99JB0fQUZszjtOhDA94Zop1WR
    FNHhWXZkiMJPKrq+1NtoJ2lDCkjR1IhsVKzGIjr9HbsqE95jly4XDVAaSM8He7lz
    mj4vYVYNO1m9w18D6h+13GSYLgY6loDmHawIfPhwxdGu1ZACB0uvxd7s0nK/f8b/
    O/F42qlcaxPk2AvxYfiYEs3iE8FdUwrex2L5s/flpBrDMjLWidZmuzSPWQozGsxX
    H8Lp4KDm5QAVd7KY4xtz8XrKE0vnsZJoUxHPVZ1jYb2mztE4m/PgVoLBzXNjbhhI
    ml5e0esIC7kaF/xOIU23LajADFkw+g/yCF+gJhB3N3K3ZLYd8zjZDGQmZjXD78t+
    Ng6/bGFnU9kx0qk8DTkS16O/QjFpSKhRoi0K435233hOJU2ftw1f8cvOYwmWiFxu
    5xumzB61IDqVe60agPlttmOOhOQBwFq0oBY2BR0LZ1kQILYDcsb0+apH/Qnt++B7
    gZt/e6EJ4s2RE1mIj6BKUTv1ocbeSgFzF8MyVZg/mSEps2nQRSjGAD+sc21IW5eB
    BW2O8vFnLyCsevUYTEodoo1nyFJZVtp5BvPFnrDvgnSvzn0lvU6qUsyTk83BB/Cl
    Tycp6xmqLIjHGEvc0pUQ6eAZ4JsA72QRUpuxh1G81d305d4WkUv2F2A1wudQBnmX
    IWGrgpg=
    -----END ENCRYPTED PRIVATE KEY-----

    Pls Help me



Relevant Pages

  • Re: CryptAPI(encryption/decryption)
    ... since symmetric encryption is faster than public key encryption. ... As per your reply I could get the handle of the private key. ... possible for B to decrypt the data using his Private Key. ... The PFX format encrypts the private key with the user supplied password ...
    (microsoft.public.pocketpc.developer)
  • Re: CryptAPI(encryption/decryption)
    ... The PFX format encrypts the private key with the user supplied password so ... exchanging private keys using this format is as safe as using the PEM ...
    (microsoft.public.pocketpc.developer)
  • Re: Format of the Public/Private key BLOB
    ... I have a PEM file with private key to decrypt it. ... CryptAPI and Linux using Openssl. ... default DER format? ...
    (microsoft.public.platformsdk.security)
  • Re: CryptAPI(encryption/decryption)
    ... I misspelled the Private Key as Primary Key. ... and the priavte key in PEM format. ... Is there any variation in the encryption format in openssl compared to CSP? ...
    (microsoft.public.pocketpc.developer)
  • Re: CryptAPI(encryption/decryption)
    ... As per your reply I could get the handle of the private key. ... encrypted data and the .pfx file containing the B's private key. ... The PFX format encrypts the private key with the user supplied password so ... exchanging private keys using this format is as safe as using the PEM ...
    (microsoft.public.pocketpc.developer)