Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


СryptEnumProviders in VBScript

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,39587
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> СryptEnumProviders in VBScript
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 СryptEnumProviders in VBScript - 11/9/2006 9:52:48 PM   
  Andremon

 

Posts: 1
Score: 0
Joined: 11/9/2006
Status: offline
Hello!

I need to get in VBScript-program list of the Crypto-Providers (CSP) installed in the System.

There is function called
СryptEnumProviders   in CryptoApi
and the example of its usage here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/seccrypto/security/cryptenumproviders.asp
and here
http://www.rsdn.ru/article/crypto/usingcryptoapi.xml  (bellow)


DWORD dwIndex=0;
DWORD dwType;
DWORD cbName;
LPTSTR pszName;

while (CryptEnumProviders(dwIndex, NULL, 0, &dwType, NULL, &cbName))
{
  if (!cbName)
    break;
   
  if (!(pszName = (LPTSTR)LocalAlloc(LMEM_ZEROINIT, cbName)))
    return;
  
  if (!CryptEnumProviders(dwIndex++, NULL, 0, &dwType, pszName, &cbName))
  {
    Error("CryptEnumProviders");
    return;
  }
  
  std::cout<<"--------------------------------"<<std::endl;
  std::cout<<"Provider name: "<<pszName<<std::endl;
  std::cout<<"Provider type: "<<dwType<<std::endl;
  
  LocalFree(pszName);
}

Please, help me to make such code in VBScript.
I'm trying to do it, by using CAPICOM, but I couldn't find any object in it, wich could help me.
Thanks!
 
 
Post #: 1
 
 RE: СryptEnumProviders in VBScript - 11/13/2006 2:11:16 AM   
  ebgreen


Posts: 4613
Score: 31
Joined: 7/12/2005
Status: offline
Well if the CryptoApi does not expose a COM interface (and I see nothing that indicates that it does) then it would be very difficult to get it to work in VBS.

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to Andremon)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> СryptEnumProviders in VBScript Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts