feat: init auth service (#2180)

This commit is contained in:
Himself65 authored and GitHub committed 2023-04-27 22:49:44 -05:00
1 parent b4bb57b2a5
commit 3a5a66a5a3
11 files changed
+303 -22

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import crypto from 'node:crypto';
import { genSalt } from 'bcrypt';
const { privateKey, publicKey } = crypto.generateKeyPairSync('ec', {
namedCurve: 'prime256v1',
publicKeyEncoding: {
type: 'spki',
format: 'pem',
},
privateKeyEncoding: {
type: 'pkcs8',
format: 'pem',
},
});
console.log('Salt:\n', await genSalt(10));
console.log('ECDSA Public Key:\n', publicKey);
console.log('ECDSA Private Key:\n', privateKey);