公開鍵/秘密鍵を作成する非常に小さなノードスクリプトがあります ホール暗号をブラウズしなくてもクライアント側で行う方法はありますかモジュール?ブラウザで公開鍵暗号化モジュールの代わりにWebCryptoAPIを使用してECDH鍵を生成
var crypto = require('crypto');
var userCurve = crypto.createECDH('prime256v1');
var userPublicKey = userCurve.generateKeys()
var userPrivateKey = userCurve.getPrivateKey();
私はこれまでのところ、これを試してみました:
// https://github.com/diafygi/webcrypto-examples#ecdh---generatekey
window.crypto.subtle.generateKey(
{
name: "ECDH",
namedCurve: "P-256", //can be "P-256", "P-384", or "P-521"
},
true, //whether the key is extractable (i.e. can be used in exportKey)
["deriveKey", "deriveBits"] //can be any combination of "deriveKey" and "deriveBits"
)
.then(function(key){
//returns a keypair object
console.log(key);
console.log(key.publicKey);
console.log(key.privateKey);
})
.catch(function(err){
console.error(err);
});
をしかし、それは、私はそれが
Emh、ありがとうございました...私は今ここで何をしたいのか覚えていません。 2年前だった。 – Endless