Questions tagged [cryptoki]
18 questions
3
votes
2 answers
Does Azure Key Vault service support PKCS#11?
If not, does anybody offer FIPS 140-2 HSMs with PKCS#11 on the Azure marketplace?

Valo
- 1,872
- 2
- 15
- 23
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
2
votes
1 answer
PKCS11 deriveKey returning different values every time
I have a master key and want to diversify/derive it into other keys (inside an HSM). After following this answer I have this code:
final java.security.Key key = token.getKeyStore().getKey(baseKeyAlias, null);
iaik.pkcs.pkcs11.objects.Key baseKey =…

lmiguelmh
- 3,074
- 1
- 37
- 53
2
votes
1 answer
What is the correct behavior of C_Decrypt in pkcs#11?
I am using C_Decrypt with the CKM_AES_CBC_PAD mechanism. I know that my ciphertext which is 272 bytes long should actually decrypt to 256 bytes, which means a full block of padding was added.
I know that according to the standard when invoking…

Amit
- 173
- 1
- 1
- 9
2
votes
1 answer
There is a log-in error using "cryptoki.dll" using the Pkcs11 library
static Module pkcs11Module = Module.getInstance(@"C:\Program Files (x86)\SafeNet\Protect Toolkit 5\Protect Toolkit C SDK\bin\sw\cryptoki.dll");
public HsmManager()
{
try
{
…

TEngineer
- 95
- 1
- 18
2
votes
1 answer
Pkcs11Exception: Method C_Initialize returned 2147483907
I have a simply method to access my HSM with Pkcs11Interop.
This is the function:
static public byte[] findTargetKeySValue(String label, String type, string command)
{
try
{
string pkcs11LibraryPath = @"C:\Program…

Piero Alberto
- 3,823
- 6
- 56
- 108
1
vote
1 answer
Why Cryptoki.C_OpenSession disconnect from HSM sometimes
I' created a web service isAlive to check if I can create session with the HSM soft using the Cryptoki ,I automated the execution of my web service using SoapUI so I execute my service in a loop each 40s ,it work well but after a number of call I…

e2rabi
- 4,728
- 9
- 42
- 69
1
vote
1 answer
What is the expected behaviour of `C_wrapKey` API if wrapping key is not provided?
In the library that I have developer passes source key and CK_INVALID_HANDLE (instead of wrapping key) to C_wrapKey API and in return I get success.
I doubt this behaviour. Is this the correct return code?

TheBeginner
- 405
- 5
- 23
0
votes
1 answer
cryptoki C_GenerateRandom fails
moved to v2 of cryptoki (CK_VERSION 204. File is 4.4.0.0). This code worked before but now doesn't:
// key is BYTE[32]
RV rv;
CK_FLAGS flags = CKF_SERIAL_SESSION | CKF_RW_SESSION;
CK_SESION_HANDLE handle;
rv = C_OpenSession(slot_id, flags,…

grunt
- 662
- 1
- 8
- 24
0
votes
0 answers
C_Initialize() is failed when CKTEEC_LOGIN_TYPE is group not user
C_Initialize() is alright when CKTEEC_LOGIN_TYPE is user.
But C_Initialize() is failed when CKTEEC_LOGIN_TYPE is group.
This results in "TEE_IOC_OPEN_SESSION failed".
What makes this error? Can't Cryptoki be initialized with CKTEEC_LOGIN_TYPE is…

Matthew Chae
- 1
- 2
0
votes
1 answer
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 use local soft HSM. But I couldn't find any…

EyezBerg
- 1
- 2
0
votes
1 answer
Generating XAdES from USB Token in c#
I’m trying to sign XML files via a USB Token in the XAdES format.
Documentation on System.Security.Cryptography.Xml is scarce. I can only find how to sign an XML with basic/default options…

Dalmo
- 1
- 2
0
votes
2 answers
FileNotFoundError: Could not find module 'libhsm.dll'
I'm trying to connect to an Eracom HSM [which is from about 15 years ago!] using Python. My Google searches led me to a library named py-hsm. It seems that it has a really straightforward usage based on the documentation. But when I tried to use it,…

Ebrahim Ghasemi
- 5,850
- 10
- 52
- 113
0
votes
1 answer
How to create Digital Signature with CAdES format using Pkcs11Interop in C# without data or document to sign
I am new in cryptographic programming.
I want to create only digital signature in C# with CAdES format using Pkcs11Interop library without having data or document or message to sign, I want the signature string only to use it on any json or xml file…

Tarek Helmy
- 1
- 1
0
votes
1 answer
CK_CHAR vs CK_BYTE in PKCS#11?
Does PKCS#11 intend CK_CHAR and CK_BYTE to have identical semantics, or is CK_CHAR intended to imply printability?
The standard PKCS#11 type header defines CK_CHAR in terms of CK_BYTE and says "character" instead of "value":
/* an unsigned 8-bit…

yossarian
- 1,537
- 14
- 21