Skip to content

Latest commit

 

History

History
133 lines (97 loc) · 9.36 KB

CODE_SAMPLES.md

File metadata and controls

133 lines (97 loc) · 9.36 KB

Pkcs11Interop code samples

Pkcs11Interop source code contains unit tests covering all methods of PKCS#11 API. Unit tests are 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.

Note: New objects/keys with "Pkcs11Interop" label are created/generated for every test method that needs to work with objects. They are always deleted at the end of the test method but they might not when the test fails. Any left-over objects with "Pkcs11Interop" label can be safely deleted e.g. with Pkcs11Admin application.

Following source files contains artifacts reused in all unit tests:

  • Source file: Settings.cs
    Static class with general test settings such as path to unmanaged PKCS#11 library, PINs etc.

  • Source file: HighLevelAPI/Helpers.cs
    Static class with utility methods that help to increase the readability of unit tests.

Following source files contain valuable code samples: