A newer version of this documentation is available.

View Latest

C# code examples

The C# code library contains example code to make logging in and to perform tasks in Net iD Portal. The code examples can be modified and compiled depending on the user’s needs. Download the C# library.

All the C# files belong to the same client class. The class is spread over separate files by using the partial class modifier.
Variable names that begins with a lower case s indicates that the variable is a string.
Variable names that begins with an underscore (_) indicates that the variable is an internal variable.

Contains the code for accessing certificates stored in the windows certificate store, by using the certificate thumbprint.


The definition of the NiP.Client class.


The constructor for the NiP.Client class.


Contains the functions needed to derive the key and IV.


A collection of exportable example functions which uses the NiP.Client class. For example CreateTask, Search etc.


Contains the login functions.


Contains the functions for sending SOAP messages. Including the logic for signing, encrypting, and constructing the messages. Uses the RequestClient class to send the SOAP-envelopes to the correct endpoint.


Contains the cryptographic PKCS #7 standard code. For digital signatures and asymmetric encryption.


Contains the function for sending SOAP requests, call on by the InvokeMessage functions with given SOAP-envelopes.


A general utility class for things such as BASE64 encoding and decoding etc.