PeculiarVentures / PKI.js

PKI.js is a pure JavaScript library implementing the formats that are used in PKI applications (signing, encryption, certificate requests, OCSP and TSP requests/responses). It is built on WebCrypto (Web Cryptography API) and requires no plug-ins.
http://pkijs.org
Other
1.25k stars 204 forks source link

Question: Create Private Key with ECDSA and Password #317

Closed Julchenwsf closed 3 years ago

Julchenwsf commented 3 years ago

Hello,

i try to use your library, but i did not find out how to create a keypair? Can you show me an short example?

Best regards Julia

rmhrisk commented 3 years ago

Hello @Julchenwsf, this library does not create cryptographic keys, instead, it uses WebCrypto for all cryptographic operations. Instead, this library creates and uses the ASN.1 data-structures that are often associated with such keys. This is a good resource on how to use WebCrypto https://github.com/diafygi/webcrypto-examples.

WebCrypto itself doesn't support the concept of a password, I suspect what you are trying to do is to export the generated key to a file in an encrypted form but there are several formats for this depending on what application you want to use it with.