Re: CryptImportKey
- From: "Mitch Gallant" <jensigner@xxxxxxxxxxxxxxxx>
- Date: Fri, 12 May 2006 12:13:09 -0400
The following .NET 2 utility tool helps with enumerating all the
keycontainers (either User or Machine) and indicates if that keypair has an
associated certificate in the CryptoAPI cert stores:
http://www.jensign.com/KeyPal
- Mitch Gallant
MVP Security
JavaScience Consulting
"lelteto" <lelteto@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:19301B5A-A967-4910-B2E8-EA8B98BD9F87@xxxxxxxxxxxxxxxx
One more note:
If you want to enumerate the imported keys You would need to enumerate
first
the containers (get a context with CRYPT_MACHINE_KEYSET +
CRYPT_VERIFYCONTEXT) then use CryptGetProvParam with PP_ENUMCONTAINERS,
for
each container name you get you would again get the context to it then
call
CryptGetUserKey with AT_KEYEXCHANGE and AT_SIGNATURE to see if they have
private keys.
Note that most MACHINE_KEYSET (and probably most user-specific) container
will NOT allow to export the private key. You can also check - after you
get
the key handle - if the key has corresponding certificate: call
CryptGetKeyParam with KP_CERTIFICATE.
.
- References:
- CryptImportKey
- From: Soeren Muehlbauer
- Re: CryptImportKey
- From: Soeren Muehlbauer
- Re: CryptImportKey
- From: lelteto
- Re: CryptImportKey
- From: lelteto
- CryptImportKey
- Prev by Date: Re: CryptImportKey
- Next by Date: Re: LookupAccountSid fails if lpSystemName is NULL
- Previous by thread: Re: CryptImportKey
- Next by thread: Store Encrypted Strings in a File
- Index(es):
Relevant Pages
|