views:

268

answers:

1

Newbie request for advise.

I have a task to develoop C# (VB.NET) service class (library) for storing/extractin user's passwords in/from Aladdin eToken devices.

Advise me any:

  • walkthroughs, tutorials
  • forums, discussions
  • code sample(s), examples

I googled but couldn't find anything helpful for starting coding.

"eToken PKI Developer’s Guide (Windows) Version 5.0 Revision B" has only 2 phrases on .NET:

1)

"Developing in Non-C/C++ Environments Both CAPI and PKCS#11 are C-style APIs. It is easy to use them from C/C++ programs. However, there are many other programming technologies available for MS Windows developers, such as:

.NET"

and

2)

"Writing Wrapper Objects

The alternate solution (for either programming environment) is to write a wrapper object that answers the particular needs of the application. Depending on these needs, the wrapper object may be a .NET assembly object, an ActiveX object or something else."

+1  A: 

Welcome!

If you want to call a C API from C#, you'll need to use P/Invoke. This lets you write a wrapper object around the DLL that will have been provided by the hardware vendor.

This is a good introduction that calls the Windows API DLLs.

Generally, for a simple C-style API, the hard part is figuring out the signature in C# for the API call. An insanely useful resource for this is pinvoke.net, which is a collaboratively edited wiki with a fair few signatures already written. If you don't find yours there, it's a great idea to contribute.

Best of luck!

Jeremy McGee