Questions tagged [pkcs11interop]

Pkcs11Interop is managed .NET wrapper for unmanaged PKCS#11 libraries that provide access to the cryptographic hardware

Pkcs11Interop is managed library written in C# that brings 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.

The library is open source and hosted on GitHub.

104 questions
7
votes
1 answer

PKCS11Interop Hash with SHA256 and Sign with RSA in two steps

I have two applications, one that calculates the SHA-256 hash of a document and the other which makes the RSA signing. Trying different things i came to the conclusion that making CKM_SHA256 and then making CKM_RSA_PKCS give a different result than…
5
votes
1 answer

ECDH1_DERIVE issues with PCKS11interop and Safenet Network HSM

Been fighting a Gemalto network HSM for a while and its about time i asked for some expert help. I am trying to derive an ECDH1 key from a known public key and a private key stored on the HSM and keep sending the HSM into some sort of panic mode…
5
votes
3 answers

Export/Import RSA keypair using PKCS11interop c# wrapper library from Thales nShield HSM?

I have generated a RSA public-private keypair in HSM using PKCS11Interop generate key API. I want to export the keypair. I used Findobject API to get the keys, the API returs an ObjectHandle , while reading attributes using GetAttributeValue API , I…
S Ghosh
  • 61
  • 1
  • 4
5
votes
1 answer

Hot to use mechanisms CKM_ECDH1_DERIVE with pkcs11interop

I bought a NitroKey HSM and wanted to derive a secret with EC. Previosly question For this, I want to use the CKM_ECDH1_DERIVE mechanisms. Which is supported by this HSM, see: Referring to the PKCS#11 specification this must be considered: The…
hdev
  • 6,097
  • 1
  • 45
  • 62
4
votes
1 answer

Extractig public key value via PKCS#11

I am using Pkcs11 library to retreive key from device: I am able to retreive ObjectHandle of public key. I try to extract public key value: var publicKeyHandle = GetPublicKeyByLabel(Session, "KEY1_QAL_PUB"); var objectAttribute =…
pwas
  • 3,225
  • 18
  • 40
4
votes
1 answer

pkcs11 interop GetSlotList(SlotsType.WithTokenPresent); returns empty list

I am using pkcs11 interop library to list available devices like this using (Pkcs11 pkcs11 = new Pkcs11(_libraryPath, AppType.SingleThreaded)) { List slots = pkcs11.GetSlotList(SlotsType.WithTokenPresent); //using slots } it works…
Prashanth
  • 507
  • 5
  • 25
3
votes
1 answer

How can I login to the windows 10 remotely by smart card With C#?

I already setup active directory to enable SmartCard logon, and could logon to the Windows through the login screen by PIN. I'm looking to find the way to logon with new session or Unlock the active session remotely. I found…
Peyman
  • 3,068
  • 1
  • 18
  • 32
3
votes
0 answers

Wrapping mechanism for ECDSA keys

I am using pkcs11interop to generate keys, and do wrap/unwrap. This is what I am using for my work https://github.com/Pkcs11Interop/Pkcs11Interop/blob/master/src/Pkcs11Interop/Pkcs11InteropTests/HighLevelAPI/_24_WrapAndUnwrapKeyTest.cs I can…
3
votes
1 answer

Changing SO-Pin in PKCS11 Interop

A straightforward question. Do you have any idea if there is a possibility to change the SO-pin of a token (ePass2003 in my case) using pkcs11 Interop? Many thanks in advance.
Ady Năstase
  • 249
  • 2
  • 9
3
votes
2 answers

How can I convert the private key stored in HSM to SignedXml.SigningKey in C#

I'm trying to implement some demo of XML signing with a certificate which stored in the HSM. I found some interesting example from this link: Sign XML Document with X509Certificate2 and modified it to using certificate and key inside the HSM with…
katika
  • 53
  • 1
  • 10
3
votes
2 answers

Signing PDF from Pkcs11Interop for CKM_ECDSA_SHA256 using SoftHSM 2.2.0 (ECDSA with SHA256) C# .net

I am trying to sign Pdf documents using Pkcs11Interop .net library. I need to use ECDSA encryption algorithm with SHA256 hash algorithm. And I am using SoftHSM 2.2.0 for storing private keys. I found an CKM enum, CKM_ECDSA_SHA256, which I am passing…
Kumar
  • 63
  • 1
  • 10
3
votes
1 answer

Multi-threaded Signature Generation C#

I am using PKCS11 Compliant Crypto Device which secures my Private Key. The Crypto Device is capable of generating 500 RSA-2048 Bit Signings per second. I have written an application in C#.NET interfaced with PKCS11Interop Wrapper. Here is my…
Karthick
  • 39
  • 8
3
votes
1 answer

How to use Pkcs11Interop with an NitroKey HSM to derive an shared secret with an EC

I bought a NitroKey HSM and manged to create an EC on it. Now I want to derive a shared secret. I found Pkcs11Interop, which seems to be the right tool for the job, but the handling is unclear. A code snipplet or link to a working project would be…
hdev
  • 6,097
  • 1
  • 45
  • 62
2
votes
1 answer

Convert Pkcs11X509Certificate to X509Certificate2 to use as ssl client cert

I am quite new to this... I have safenet luna hsm storing certs. I need to retrieve cert and use it as client cert in an ssl session. I am trying to use Pkcs11Interop (and also Pkcs11X509Store) without success. I cant get the X509Certificate2 with…
2
votes
1 answer

Create signature using Pkcs11Interop without token password

I'm using the Pkcs11Interop in combination with a certificate on a usb stick to sign pdf documents. The following steps are executed to sign a document: Load the pkcs11 library (LoadPkcs11Library) Get a slot of the selected smartcard/usb…
Manuel
  • 1,985
  • 3
  • 31
  • 51
1
2 3 4 5 6 7