create sha256 hash
This commit is contained in:
parent
4a11207dcd
commit
89c688c955
|
@ -55,7 +55,9 @@ function generateRsaKeypair(bitlen, exp, cb) {
|
||||||
, privateKeyPem: pki.privateKeyToPem(keypair.privateKey) // ascii PEM: ----BEGIN...
|
, privateKeyPem: pki.privateKeyToPem(keypair.privateKey) // ascii PEM: ----BEGIN...
|
||||||
};
|
};
|
||||||
|
|
||||||
// I would have chosen sha1 or sha2... but whatever
|
// for account id
|
||||||
|
pems.publicKeySha256 = crypto.createHash('sha256').update(pems.publicKeyPem).digest('hex');
|
||||||
|
// for compat with python client account id
|
||||||
pems.publicKeyMd5 = crypto.createHash('md5').update(pems.publicKeyPem).digest('hex');
|
pems.publicKeyMd5 = crypto.createHash('md5').update(pems.publicKeyPem).digest('hex');
|
||||||
// json { n: ..., e: ..., iq: ..., etc }
|
// json { n: ..., e: ..., iq: ..., etc }
|
||||||
pems.privateKeyJwk = toAcmePrivateKey(keypair.privateKey);
|
pems.privateKeyJwk = toAcmePrivateKey(keypair.privateKey);
|
||||||
|
|
|
@ -36,7 +36,9 @@ function generateRsaKeypair(bitlen, exp, cb) {
|
||||||
, privateKeyPem: keypair.toPrivatePem().toString('ascii') // ascii PEM: ----BEGIN...
|
, privateKeyPem: keypair.toPrivatePem().toString('ascii') // ascii PEM: ----BEGIN...
|
||||||
};
|
};
|
||||||
|
|
||||||
// I would have chosen sha1 or sha2... but whatever
|
// for account id
|
||||||
|
pems.publicKeySha256 = crypto.createHash('sha256').update(pems.publicKeyPem).digest('hex');
|
||||||
|
// for compat with python client account id
|
||||||
pems.publicKeyMd5 = crypto.createHash('md5').update(pems.publicKeyPem).digest('hex');
|
pems.publicKeyMd5 = crypto.createHash('md5').update(pems.publicKeyPem).digest('hex');
|
||||||
// json { n: ..., e: ..., iq: ..., etc }
|
// json { n: ..., e: ..., iq: ..., etc }
|
||||||
pems.privateKeyJwk = toAcmePrivateKey(pems.privateKeyPem);
|
pems.privateKeyJwk = toAcmePrivateKey(pems.privateKeyPem);
|
||||||
|
|
Loading…
Reference in New Issue