Questions tagged [softhsm]

SoftHSM is software that emulates a PKCS11 Hardware Security Module for development and testing.

An HSM or Hardware Security Module is a PKCS11 compliant and tamper-proof hardware component for the management and storage of cryptographic assets such as keys and certificates, and for offloading cryptographic operations.

SoftHSM is a software emulation of a PKCS11 compliant HSM for purposes of development, training and testing. This provides a cost-effective alternative to purchasing dedicated hardware components for non-Production use. It is being developed as a part of the OpenDNSSEC project.

68 questions
2
votes
1 answer

how to switch to CKM_AES_KEY_WRAP_PAD during key wrapping in SOFTHSM2 using JAVA PKCS11 IAIK

I am making use of SoftHSM to generate isometric keys in Java. Currently, I need to wrap private keys using the wrapKey function provided in IAIK PKCS11 library (JAVA) and I'm having a problem with the key wrapping operation in cipher.getInstance().…
zinoadidi
  • 194
  • 1
  • 13
2
votes
1 answer

PKCS#11 - creating ECDSA key

Consider i have sample sample ECDSA public key with the following parameters: Point Value 03 42 00 04 C9 A3 63 92 24 9C 7C 3B CD 6B 3D 89 F6 16 13 21 B9 AC 99 42 60 C7 4A E2 7D 4A 03 80 BE 80 47 C1 3D FA 08 70 F9 8F 9F 65 BB 81 A5 5B 7C 6B 21 ED …
pwas
  • 3,225
  • 18
  • 40
2
votes
2 answers

SoftHSM2 java not working

I am trying to do POC on SoftHSM 2 , but some how I am getting below issue . Exception in thread "main" java.security.ProviderException: Initialization failed at sun.security.pkcs11.SunPKCS11.(SunPKCS11.java:376) …
Slok
  • 576
  • 1
  • 12
  • 27
2
votes
1 answer

Sign data with SoftHSM

I want to sign (or encrypt) some data using SoftHSMv2 and pkcs11-tool. So far, I generated a RSA keypair with : pkcs11-tool --module=/usr/local/lib/softhsm/libsofthsm2.so -l --pin mypin -k --key-type rsa:1024 --id 01 --label mykey But when I try…
WoBuGs
  • 21
  • 4
1
vote
1 answer

How to extract objects from SoftHSM with a JNA interface?

I am using SoftHSM and I have to develop a Java application to extract objects of it. I have a "Data" object of label "MY_DATA" and I have successfully opened the session on the right token. But even if there is no error returned code, I cannot get…
1
vote
0 answers

How to use a pkcs11-tool generated elliptic key with openssl

I have managed to generate a RSA keypair in softHSM with pkcs11-tool, and do verification og signed data with that using openssl. pkcs11-tool --module /usr/lib/softhsm/libsofthsm2.so -l --token-label token-label -k --key-type rsa:2048 …
Kjeld Flarup
  • 1,471
  • 10
  • 15
1
vote
1 answer

PKCS11 does not recognize new slot created in softhsm in runtime

I have a piece of code to import key and certificate into hsm using java. The problem is that when I run the java back-end to execute that api, it is ok when using the slots which were created before. However the problem here, when I create new slot…
1
vote
1 answer

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 mechanism CKM_ECDSA_SHA512 . I tried to define key…
1
vote
0 answers

How can I setup configuration SoftHSM by Java code?

I'm using softhsm.cfg to config connection from a client to the server. Detail that, name = SoftHSM library = F:\SoftHSM2\lib\softhsm2-x64.dll slot = 767671965 attributes(generate, *, *) = { CKA_TOKEN = true } attributes(generate,…
1
vote
1 answer

SoftHSM2 return "Error parsing configuration"

I'm trying to use Softhsm2 in my project. Unfortunately, it keeps showing java.security.ProviderException: Error parsing configuration I try reinstall the app but problem still remain. May I know what I missed? Please check below source code,…
Ikmal
  • 11
  • 4
1
vote
0 answers

softHSM integration with Hyperledger Fabric

I am trying to integrate softHSM with Hyperledger Fabric. I have followed the below steps: I have cloned the repo from this link https://github.com/hyperledger/fabric-ca (main-branch) Executed the below 3 commands from the above directory. After…
1
vote
1 answer

How to go about writing a PKCS#11 Wrapper around my device?

I have made a very basic Soft-HSM - only for personal learning purposes. I want to add a PKCS#11 interface to it. Where can I learn about this, or perhaps find something open source already written for studying? I realize that this could be…
Kladskull
  • 10,332
  • 20
  • 69
  • 111
1
vote
2 answers

How to Update particular Attribute after finding an object. getting error Method C_SetAttributeValue returned CKR_ATTRIBUTE_READ_ONLY

I am trying to update an attribute after finding the object. Have tried out different cases. My creation code: using (var pkcs11 = new Pkcs11(@"C:\SoftHSM2\lib\softhsm2.dll", AppType.SingleThreaded)) { var slot =…
Kamran Shahid
  • 3,954
  • 5
  • 48
  • 93
1
vote
1 answer

No installed provider supports this key: sun.security.pkcs11.P11Key$P11SecretKey while using SoftHSM2 AES Key

I'm willing to encrypt/decrypt data by using an AES Key stored in a softHSM2 software. I'm creating my key with the following code: String configName = "C:\\SoftHSM2\\etc\\pkcs11.cfg"; cipher = Cipher.getInstance("AES"); Provider p =…
tiamat
  • 879
  • 2
  • 12
  • 35
1
vote
1 answer

peer node start throwing Could not find default pkcs11 BCCSP error

I am trying to run Hyperledger fabric peer with SoftHSM enabled. Fabric-ca-server is already running with SoftHSM enabled and all the certificates are generated with HSM enabled. Initially, when I was trying to run fabric-ca-server it was throwing…
Akshay Sood
  • 6,366
  • 10
  • 36
  • 59