Pkcs11Interop | Managed .NET wrapper for unmanaged PKCS # 11 libraries | Cryptography library

 by   Pkcs11Interop C# Version: v5.1.2 License: Apache-2.0

kandi X-RAY | Pkcs11Interop Summary

kandi X-RAY | Pkcs11Interop Summary

Pkcs11Interop is a C# library typically used in Security, Cryptography applications. Pkcs11Interop has no bugs, it has no vulnerabilities, it has a Permissive License and it has low support. You can download it from GitHub.

PKCS#11 is cryptography standard maintained by the OASIS PKCS 11 Technical Committee (originally published by RSA Laboratories) that defines ANSI C API to access smart cards and other types of cryptographic hardware. Pkcs11Interop is managed library written in C# that brings full power of PKCS#11 API to the .NET environment. It loads unmanaged PKCS#11 library provided by the cryptographic device vendor and makes its functions accessible to .NET application.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              Pkcs11Interop has a low active ecosystem.
              It has 219 star(s) with 75 fork(s). There are 24 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 17 open issues and 150 have been closed. On average issues are closed in 21 days. There are 1 open pull requests and 0 closed requests.
              It has a neutral sentiment in the developer community.
              The latest version of Pkcs11Interop is v5.1.2

            kandi-Quality Quality

              Pkcs11Interop has 0 bugs and 0 code smells.

            kandi-Security Security

              Pkcs11Interop has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              Pkcs11Interop code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              Pkcs11Interop is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              Pkcs11Interop releases are available to install and integrate.
              Installation instructions are available. Examples and code snippets are not available.
              Pkcs11Interop saves you 4 person hours of effort in developing the same functionality from scratch.
              It has 13 lines of code, 0 functions and 949 files.
              It has low code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi's functional review helps you automatically verify the functionalities of the libraries and avoid rework.
            Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of Pkcs11Interop
            Get all kandi verified functions for this library.

            Pkcs11Interop Key Features

            No Key Features are available at this moment for Pkcs11Interop.

            Pkcs11Interop Examples and Code Snippets

            No Code Snippets are available at this moment for Pkcs11Interop.

            Community Discussions

            QUESTION

            CKR_GENERAL_ERROR when configuring SunPKCS11 with softhsm
            Asked 2021-Apr-25 at 04:02

            I'm getting CKR_GENERAL_ERROR when configuring SunPKCS11 with softhsm.

            Platform:

            Environment variables:

            ...

            ANSWER

            Answered 2021-Apr-25 at 04:02

            Just setting SOFTHSM2_CONF environment variable in launcher, the provider was successfully configured and keystore could load instantly.

            It seems not getting system environment variable.

            Source https://stackoverflow.com/questions/67249557

            QUESTION

            Pkcs11Interop empty slot list
            Asked 2021-Mar-28 at 16:47

            I recently created a Console app which held the context of Pkcs11Interop library, along with HSM dll. It worked fine, however I needed to rewrite the code to Windows Service (I hosted it as gRPC service since it's .NET Core). After hosting WS, it ocurred that the slot list on factories.Pkcs11LibraryFactory.LoadPkcs11Library(factories, libraryPath, AppType.MultiThreaded).GetSlotList(SlotsType.WithOrWithoutTokenPresent).Find(slot => slot.SlotId == slotId) returns an empty list of slots, even though it returned list of 3 elements in console app.

            ...

            ANSWER

            Answered 2021-Mar-28 at 16:47

            Pkcs11Interop returns slots received by calling C_GetSlotList function of unmanaged PKCS#11 library. So if you get 0 slots then C_GetSlotList returned 0 slots. You need to discuss this situation with the vendor of your PKCS#11 library who might know why their library does not see any slots.

            Source https://stackoverflow.com/questions/66814151

            QUESTION

            pkcs11Interop problem with WaitForSlotEvent when reader is removed
            Asked 2021-Feb-23 at 14:25

            I set up pkcs11Interop Library as follows

            ...

            ANSWER

            Answered 2021-Feb-23 at 14:25

            > Is a DispatcherTimer ok for WaitForSlotEvent?

            It should be OK in general. You might also consider using WaitForSlotEvent in blocking mode called from a separate thread.

            > What should I do to avoid C_WaitForSlotEvent CKR_DEVICE_ERROR?

            You need to ask the vendor of your unmanaged PKCS#11 library.

            AFAIK C_WaitForSlotEvent was designed for token/card related events not for slot/reader related events. PKCS#11 specification states that when you add or remove slot/reader you might need to reload PKCS#11 library or even restart OS:

            On some platforms, or earlier PKCS11 compliant libraries, it may be necessary to successfully call C_Initialize or to restart the entire system.

            > Does pkcs11Interop handle the adding and removing of slots (ie. SmartCard Readers)?

            Pkcs11Interop does nothing else but gives you access to unmanaged function C_WaitForSlotEvent described in PKCS#11 specification.

            > If pkcs11Interop does not handle adding and removing slots is polling the only way and what would be the best to poll?

            See answer to first question.

            Source https://stackoverflow.com/questions/66333956

            QUESTION

            How can I assign a negative number to the function that accepts the UINT parameter
            Asked 2021-Jan-26 at 12:31

            From the meigk/pkcs11 package. Is there any way to assign a negative value in the Login function as userType? Because the HSM model that I'm working with, supports one more additional role except for the following standard roles and I want to login with that role.

            Standard roles:

            ...

            ANSWER

            Answered 2021-Jan-26 at 12:28

            If type of the parameter is uint, you can only pass values that are assignable to the type uint (as stated in Spec: Calls). And the valid range of uint does not include negative numbers.

            What you may do is convert your negative value to uint. Converting a negative int to uint is roughly equivalent to subtracting the absolute value from the max value of int plus 1. So if your other constants are small, this won't cause a collision.

            For example:

            Source https://stackoverflow.com/questions/65900994

            QUESTION

            Where can i find the PKCS11 unmanaged library for the cherry SmartTerminal ST-1144
            Asked 2021-Jan-12 at 14:38

            I want to use the cherry SmartTerminal ST-1144 in order to finally sign pdf documents with certificates from a smartcard. I do use the .net PKCS11Interop. In the following code i need to provide the unmanaged PKCS11 library for the Cherry SmartTerminal ST-1144:

            ...

            ANSWER

            Answered 2021-Jan-12 at 14:38

            PKCS#11 library is not driver for card reader (in your case Cherry SmartTerminal ST-1144). PKCS#11 library is driver for the card. So I highly doubt such library is installed as a part of package provided by Cherry. It should be installed as part of software you got with your smartcard.

            Source https://stackoverflow.com/questions/65684946

            QUESTION

            RSA OAEP Encryption with SHA-256 fails while with SHA-1 is OK
            Asked 2020-Nov-18 at 21:38

            I'm using Pkcs11Interop Library and trying to test encryption and decryption with RSA_PKCS_OAEP mechanism.

            ...

            ANSWER

            Answered 2020-Nov-18 at 21:38

            I had the same problem with Luna HSM (but was given CKR_MECHANISM_PARAM_INVALID).

            That version of HSM simply did not support OAEP with SHA-256 and firmware upgrade was needed. After firmware upgrade it worked without any problems. Check if your device supports this variant.

            Your code seems ok, I used (in java):

            Source https://stackoverflow.com/questions/64888751

            QUESTION

            AWS CloudHSM PKCS#11 with PKCS11Interop giving error for Wrap operation CKR_ARGUMENTS_BAD
            Asked 2020-May-12 at 08:45

            I am using latest AWS cloud HSM and there PKCS vendor libraries with PKCS11Interop c# library.
            Trying to simulate there sample code for CKM.CKM_RSA_AES_KEY_WRAP from AWS PKCS Samples

            Gives below error while wrapping AES 256 Secret key.

            Net.Pkcs11Interop.Common.Pkcs11Exception: 'Method C_WrapKey returned CKR_ARGUMENTS_BAD' at Net.Pkcs11Interop.HighLevelAPI80.Session.WrapKey(IMechanism mechanism, IObjectHandle wrappingKeyHandle, IObjectHandle keyHandle)

            My sample code

            ...

            ANSWER

            Answered 2020-May-12 at 08:45

            I was doing everything right, just had forgot to send initialised rsaParams with the call.

            Source https://stackoverflow.com/questions/61459368

            QUESTION

            AWS cloudhsm with PKCS#11 not able to export RSA public key
            Asked 2020-May-12 at 08:20

            I am generating a RSA key pair with AWS cloud HSM with PKCS11Interop c# library on top of AWS vendor PKCS library. Wanted to export a public key from HSM with PKCS 11 getAttributeValue methods.

            The response states that attributes cannot be read, I have marked all the attributes values correctly to be able to export a key, can somebody point out what I am doing wrong ?

            My sample code

            ...

            ANSWER

            Answered 2020-May-02 at 08:12

            RSA public key objects do not have CKA_VALUE attribute. Instead, there are two attributes called CKA_MODULUS and CKA_PUBLIC_EXPONENT that make up the key value.

            Source https://stackoverflow.com/questions/61500862

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install Pkcs11Interop

            Archives with the source code and binaries can be downloaded from [our releases page](https://github.com/Pkcs11Interop/Pkcs11Interop/releases/). Official [NuGet packages](https://www.nuget.org/packages/Pkcs11Interop/) are published in nuget.org repository. All official items are signed with [GnuPG key or code-signing certificate of Jaroslav Imrich](https://www.jimrich.sk/crypto/) and announced via [public mailing list](https://groups.google.com/d/forum/pkcs11interop).

            Support

            It is highly recommended that before you start using Pkcs11Interop you get familiar at least with "Chapter 2 - Scope", "Chapter 6 - General overview" and "Chapter 10 - Objects" of [PKCS#11 v2.20](https://github.com/Pkcs11Interop/PKCS11-SPECS/tree/master/v2.20) specification (or equivalent chapters of any previous or subsequent specification version). Pkcs11Interop API is fully documented with the inline XML documentation that is displayed by the most of the modern IDEs during the application development. Detailed [Pkcs11Interop API documentation](https://pkcs11interop.net/doc/) is also available online. Following topics are covered by standalone documents: * [Pkcs11Interop library architecture](doc/ARCHITECTURE.md) * [Getting started with Pkcs11Interop](doc/GETTING_STARTED.md) * [Pkcs11Interop code samples](doc/CODE_SAMPLES.md) * [Troubleshooting Pkcs11Interop with PKCS11-LOGGER](doc/TROUBLESHOOTING.md).
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries

            Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Cryptography Libraries

            dogecoin

            by dogecoin

            tink

            by google

            crypto-js

            by brix

            Ciphey

            by Ciphey

            libsodium

            by jedisct1

            Try Top Libraries by Pkcs11Interop

            PKCS11-SPECS

            by Pkcs11InteropC

            pkcs11-logger

            by Pkcs11InteropC

            pkcs11-mock

            by Pkcs11InteropC

            Pkcs11Interop.X509Store

            by Pkcs11InteropC#

            empty-pkcs11

            by Pkcs11InteropC