CryptoSys PKI Toolkit Manual

Using with .NET: C# and VB.NET

To use the .NET interface with C# and VB.NET/VB2005/VB200x:

  1. Copy the dotnet diCrSysPKINet.dll library file into a convenient folder (the setup program puts this file by default in C:\Program Files\CryptoSysPKI\DotNet).
  2. In your application, add a reference to the library:
    1. Project > Add Reference.
    2. In the .NET tab, click on the Browse button to find and select the library file diCrSysPKINet.dll.
    3. Click on OK and the wizard will add the reference of the class library to your project.
  3. Add the line (for C#)
    using CryptoSysPKI;
    

    or (for VB.NET)

    Imports CryptoSysPKI
    

    to your code.

  4. Call the methods in the various classes. Note that the methods in the .NET interface may have different parameters and return values to the functions in the core VB6/C DLL.

Alternatively, with C#, you can just include the source code module CryptoSysPKI.cs in your project and there is no need to reference the class library DLL.

All methods in the CryptoSysPKI .NET Class Library are static methods. You do not need to instantiate or dispose of any objects.

For examples, see the test code TestPKIcsharp.cs and TestPKIvbnet.vb provided in the distribution.

In older versions we suggested using direct upgrades of the VB6 code in VB.NET with all the pre-dimensioning and other unsafe practices. The .NET Class Library interface is cleaner, safer and more convenient. If you are writing VB.NET code from scratch, please use the .NET Class Library interface. If you need to upgrade old VB6 code, see Converting VB6 to VB.NET.

[Contents] [Index]

[HOME]   [NEXT: Security Issues...]

Copyright © 2004-9 D.I. Management Services Pty Ltd. All rights reserved.