108 questions
0
votes
1
answer
159
views
Calculating DigestValue of SignedProperties in XAdES
I am trying to create an application to sign xml documents in xades format by using PKCS11Interop library. I have a xades sign application provided by a government institute to test my results. I am ...
0
votes
0
answers
228
views
Pkcs11Interop with Softhsm and Docker - Method C_Initialize returned CKR_GENERAL_ERROR
I have a dotnet8 console app that works fine with SoftHsmv2 on windows.
I then dockerised the console app with softhsm installed & intialised during docker build as below:
#noble tag for Ubuntu 24....
0
votes
1
answer
183
views
Unwrapped key object via Pkcs11Interop library does not get persisted in Thales Luna HSM
I am using Pkcs11Interop library in a .Net application to communicate with Thales Luna HSM. And unwrapping a AES key via RSA key using CKM_RSA_PKCS mechanism.
But unwrapped AES key does not gets ...
0
votes
1
answer
195
views
Pkcs11interop CKR_FUNCTION_NOT_PARALLEL Error
I have developed a worker service in C# Core that signs files using a certificate stored in a USB token with PKCS11Interop. The service creates two Tasks, each intended to sign files with a different ...
0
votes
1
answer
349
views
Different signatures when signing the same data using the same private key in Pkcs11Interop and RSACryptoServiceProvider
I want to use a Hardware Security Module (HSM) to sign a string. Specifically, I am using the ePass3003Auto to do so. I have stored the certificate in the HSM, which I have it's private key. Using the ...
1
vote
0
answers
84
views
pkcs11interop session pops up the wrong "Token logon" window , instead of "Digital Signature PIN logon" window (thales/Gemalto vendor eTPKCS11.dll)
I am using the pkcs11interop to create the session for a token
and force the "Digital Signature PIN logon" popup to appear for user.
but wrong popup shows "Token logon":
but this ...
1
vote
2
answers
164
views
PkcsInterop throws Dll not found on Linux
I am getting familiar with PKCS11 and using PKCSInterop. For now, I only want to check the tokens I created on my OS (arch linux) with softhsm2-util.
I installed PKCS11Interop through Nuget, which I ...
0
votes
1
answer
690
views
Connect to remote HSM with PKCS11interop
I'm just practising about Safenet soft HSM and PKCS11interop library. I am curios about how the librar decides to connect which HSM? I think the cryptoki library created in my local is configured to ...
0
votes
1
answer
593
views
BouncyCastle gets error 'public key presented not for certificate signature' for retrieved ECPublicKey
I am trying to use BouncyCastle library for generating X509Certificate in a .Net application, meanwhile i want to use keys stored in HSM.
My solution is generating EC key-pair in HSM, returning ...
2
votes
1
answer
896
views
How to use SHA512 hashing algorithm with elliptic curve to sign, in PKCS11Interop?
In am using PKCS11Interop in C#, i got CKR_MECHANISM_INVALID error while trying to use method Sign. The key object i am using is of mechanism type CKM_EC_KEY_PAIR_GEN . but at signing time, i use ...
1
vote
1
answer
464
views
HSM RSA OAEP Encryption with Asymmetric hashes fails
I am using the PKCS11Interop library to Encrypt and Decrypt data with the parameters below.
CK_RSA_PKCS_OAEP_PARAMS p = new CK_RSA_PKCS_OAEP_PARAMS();
p.HashAlg = (uint)CKM.CKM_SHA256;
p.Mgf = (uint)...
1
vote
2
answers
910
views
How to AuthenticateAsServer when Certificate is in HSM and privateKey is not embeded in Certificate and PrivateKey is not extractable from HSM
I want to ask a qusetion according to my code, My code is as bellow:
in AuthenticateAsServer I get "The server mode SSL must use a certificate with the associated private key" error cause ...
2
votes
1
answer
281
views
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) ...
0
votes
1
answer
710
views
How to create a EC Key Pair?
I am trying to create an EC key pair using the Pkcs#11 interop library (5.1.2) but every time I try to generate one it returns CKR_TEMPLATE_INCOMPLETE or CKR_DOMAIN_PARAMS_INVALID. I am using SC650 ...
0
votes
1
answer
724
views
PKCS11 encrypt hash with RSA private key
We are building a Digitial Signing platform.
Per user we generate a RSA 2048 key pair in an HSM, and issue a X509 digital certificate.
During PAdEs or CAdES digital signing (Enveloping) we get the ...