Re: CryptImportKey



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.



.



Relevant Pages

  • Re: Export list of users in each OU
    ... Perhaps a workboot for each container under accounts. ... The first step is to enumerate all containers (domains, OU's, and container ... Sub EnumDomains(ByVal objParent) ... ' Recursive subroutine to enumerate users in domains. ...
    (microsoft.public.windows.server.scripting)
  • Re: Export list of users in each OU
    ... I dont want to do the entire domain, but a specific container. ... The first step is to enumerate all containers (domains, OU's, and container ... Sub EnumDomains(ByVal objParent) ... ' Recursive subroutine to enumerate users in domains. ...
    (microsoft.public.windows.server.scripting)
  • Enumerate everything below and including Domain users?
    ... Domain users, one called a users and one called b users. ... What do I need to add to this script to get it two enumerate everything ... Dim OutPutFile ... 'Enumerate Container ...
    (microsoft.public.scripting.vbscript)
  • Re: GCC 4.0 Ada.Containers Cursor danger.
    ... Enumerate all elements in the container [i.e. define an ... > There is no such thing as an "unordered" container (and here we're ... Or a text editor cursor. ... Studio IDE handles text cursors surprisingly correct AdaGIDE ...
    (comp.lang.ada)