Encryption and Decryptiong using Certificates
From: sandi (anonymous_at_discussions.microsoft.com)
Date: 04/17/04
- Previous message: Amit Rahul [MS]: "Re: LsaRemoveAccountRights"
- Next in thread: Hao Zhuang [MSFT]: "Re: Encryption and Decryptiong using Certificates"
- Reply: Hao Zhuang [MSFT]: "Re: Encryption and Decryptiong using Certificates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Fri, 16 Apr 2004 23:18:55 -0700
Hi All
I Have many certificates in my server MY Store with the
private keys. All the clients will have certificates
without the private keys, only the public key.
Whenever a user wants to sign a document he will sign
from the server using his certificate. The server will be
always loged in as administrator. And security is
porvided by the physical access to the server.
First I export the public key from the certificate to
say, a file
CryptAcquireContext()
CertOpenSystemStore() "MY"
CertFindCertificateInStore() Subject Name Str
CryptAcquireCertificatePrivateKey()
CryptGetUserKey()
CryptExportKey(,,PUBLICKEYBLOB,,)
Then I encrypt.This is another application
1.CryptAcquireContext()
2.CertOpenSystemStore() "MY"
3.CertFindCertificateInStore() "Subject name "
4.CryptAcquireCertificatePrivateKey()
5.CryptGetUserKey()
6.CryptEncrypt(), an array of 16 bytes
I got it encrypted. Now I want to decrypt it using the
public key from the certificates. This another application
1.CryptAcquireContext()
2.CryptImportKey()
3.CryptDecrypt()
But Decryption fails with error 8009000D "Keys Does not
exit"..Pleeaseeeeeeeeeeeeeee help me....
I dont know wats happening...
Thanks and lots of love...
sandi
- Previous message: Amit Rahul [MS]: "Re: LsaRemoveAccountRights"
- Next in thread: Hao Zhuang [MSFT]: "Re: Encryption and Decryptiong using Certificates"
- Reply: Hao Zhuang [MSFT]: "Re: Encryption and Decryptiong using Certificates"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|