Modify public key only in the key container

From: Phoebe (Phoebe_at_discussions.microsoft.com)
Date: 02/28/05


Date: Mon, 28 Feb 2005 03:55:04 -0800

I am writing a custom CSP. My private key is stored in another computer. I
have the public key. I want to modify the public key persistently in a key
container to be my public key, I don't care about the private key as I don't
use it. Here is what I did:

1. create a key pair in a key container using CPGenKey. Set the flag
CRYPT_EXPORTABLE
2. export PRIVATEKEYBLOB using CPExportKey
3. modify the public key modulus/exponent to be my public key 's
modulus/exponent.
4. Import the PRIVATEKEYBLOB back into my key conainter. I got the error msg
 80090005(BAD DATA)

Can someone help me that? or Is it possible to do it?

Thank you

Phoebe



Relevant Pages

  • RE: PGP scripting...
    ... cryptosystems, ... In these systems divulging your private key compromises the public ... Here is a quick over view of the public key encryption routines (the ...
    (SecProg)
  • Re: Private & Public Key storage location
    ... with that you complete the 'certificate' to have both public and private key ... To view the complete cert, you access the cert mmc, ... its end & send only the public key to the CA along with the other websites ... The CA never know the private key of the website. ...
    (microsoft.public.inetserver.iis.security)
  • CryptImportKey NTE_BAD_KEY error.
    ... of the private key is just fine but when I try to import the public key I ... // This Asymetric key set will be used to create the Autherization Code. ... delete psBuffer; ...
    (microsoft.public.security)
  • Re: Private & Public Key storage location
    ... client use the public key to ... corresponds to this certiticate' when you view the cert. ... it will has the private key as well. ... installed for your website, it will be sent to all the clients who connect ...
    (microsoft.public.inetserver.iis.security)
  • CryptImportKey NTE_BAD_KEY error.
    ... of the private key is just fine but when I try to import the public key I ... // This Asymetric key set will be used to create the Autherization Code. ... delete psBuffer; ...
    (microsoft.public.platformsdk.security)