データを暗号化するには、nodejs の証明書から公開鍵を読み取る必要があります。
var certificate = fs.readFileSync('keys/certificate.cer');
var cipher = ursa.createPublicKey(----->certificate.getPulicKey()<------);
var symmetric = crypto.randomBytes(128);
var Nonce = new Buffer(cipher.encrypt(symmetric, "utf8", "utf8")).toString('base64');
var cipher = crypto.createCipher('aes128', symmetric);
cipher.update("Transporte", 'utf8', 'base64');
var Password = cipher.final('base64');
var d = new Date();
var cipher = crypto.createCipher('aes128', symmetric);
cipher.update(d.toUTCString(), 'utf8', 'base64');
var Created = cipher.final('base64');
何かのようなもの:
Dim certCP As New System.Security.Cryptography.X509Certificates.X509Certificate2
certCP.Import(certificate)
Dim publicKey As String = certCP.PublicKey.Key.ToXmlString(False)
VBで...
nodejsでそれを行う方法はありますか?