<commit_before># Pkcs11Interop code samples

Pkcs11Interop source code contains unit tests covering all methods of PKCS#11 API. Unit tests are well documented and they also serve as official code samples.

**WARNING: Our documentation and code samples do not cover the theory of security/cryptography or the strengths/weaknesses of specific algorithms. You should always understand what you are doing and why. Please do not simply copy our code samples and expect it to fully solve your usage scenario. Cryptography is an advanced topic and one should consult a solid and preferably recent reference in order to make the best of it.**

Following source files contains artifacts reused in all unit tests:

* Source file: [Settings.cs](../src/Pkcs11Interop/Pkcs11InteropTests/Settings.cs)  
  Static class with general test settings such as path to unmanaged PKCS#11 library, PINs etc.

* Source file: [HighLevelAPI/Helpers.cs](../src/Pkcs11Interop/Pkcs11InteropTests/HighLevelAPI/Helpers.cs)  
  Static class with utility methods that help to increase the readability of unit tests.

Following source files contain valuable code samples:

* Test file: [HighLevelAPI/_01_InitializeTest.cs](../src/Pkcs11Interop/Pkcs11InteropTests/HighLevelAPI/_01_InitializeTest.cs)  
  Involved PKCS#11 functions: C_Initialize, C_Finalize  
  Demonstrates how to initialize and release PKCS#11 library in single-threaded or multi-threaded applications.

* Test file: [HighLevelAPI/_02_GetInfoTest.cs](../src/Pkcs11Interop/Pkcs11InteropTests/HighLevelAPI/_02_GetInfoTest.cs)  
  Involved PKCS#11 functions: C_GetInfo  <commit_msg>Temporary test object description mentioned in #34<commit_after># Pkcs11Interop code samples

Pkcs11Interop source code contains unit tests covering all methods of PKCS#11 API. Unit tests are well documented and they also serve as official code samples.


**WARNING: Our documentation and code samples do not cover the theory of security/cryptography or the strengths/weaknesses of specific algorithms. You should always understand what you are doing and why. Please do not simply copy our code samples and expect it to fully solve your usage scenario. Cryptography is an advanced topic and one should consult a solid and preferably recent reference in order to make the best of it.**

Following source files contains artifacts reused in all unit tests:

* Source file: [Settings.cs](../src/Pkcs11Interop/Pkcs11InteropTests/Settings.cs)  
  Static class with general test settings such as path to unmanaged PKCS#11 library, PINs etc.

* Source file: [HighLevelAPI/Helpers.cs](../src/Pkcs11Interop/Pkcs11InteropTests/HighLevelAPI/Helpers.cs)  
  Static class with utility methods that help to increase the readability of unit tests.

Following source files contain valuable code samples:

* Test file: [HighLevelAPI/_01_InitializeTest.cs](../src/Pkcs11Interop/Pkcs11InteropTests/HighLevelAPI/_01_InitializeTest.cs)  
  Involved PKCS#11 functions: C_Initialize, C_Finalize  
  Demonstrates how to initialize and release PKCS#11 library in single-threaded or multi-threaded applications.

* Test file: [HighLevelAPI/_02_GetInfoTest.cs](../src/Pkcs11Interop/Pkcs11InteropTests/HighLevelAPI/_02_GetInfoTest.cs)  
  Involved PKCS#11 functions: C_GetInfo  
{'fraction_non_alphanumeric': 0.058588957055214726, 'fraction_numerical': 0.02392638036809816, 'mean_word_length': 5.129699248120301, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3055457', 'n_tokens_mistral': 953, 'n_tokens_neox': 898, 'n_words': 362}