Code Monkey home page Code Monkey logo

Comments (2)

reznik99 avatar reznik99 commented on July 27, 2024

To Import an RSA Public Key, it should be in X.509 SubjectPublicKeyInfo (SPKI) format.
PEM with the -----BEGIN PUBLIC KEY----- header.

from softhsmv2.

catfish-amine avatar catfish-amine commented on July 27, 2024

This is how I generate my pair of RSA keys:

openssl genpkey -algorithm RSA -out private.pem -pkeyopt rsa_keygen_bits:1024
openssl pkcs8 -topk8 -nocrypt -in private.pem -out private_pkcs8.key
openssl rsa -pubout -in private_pkcs8.key -out public.pem

and then I try to import them like this :

softhsm2-util --import private_pkcs8.key --token "TEST" --label "TEST_PRIV" --id A001 --force
=> The key pair has been imported.

softhsm2-util --import public.pem --token "TEST" --label "TEST_PUB" --id A002 --force
=> ERROR: Could not read the PKCS#8 file. Maybe it is encypted (--file-pin )

So basically I am not able to import the public key even that it is actually in the format mentioned in the answer above

from softhsmv2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.