feat: add local signup and Kakao verification gate
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
import { constants, publicEncrypt } from 'node:crypto';
|
||||
|
||||
export interface GatewayPasswordPublicKey {
|
||||
keyId: string;
|
||||
algorithm: 'RSA-OAEP-256';
|
||||
publicKeyPem: string;
|
||||
}
|
||||
|
||||
export const sealGatewayPassword = (password: string, key: GatewayPasswordPublicKey) => ({
|
||||
keyId: key.keyId,
|
||||
ciphertext: publicEncrypt(
|
||||
{
|
||||
key: key.publicKeyPem,
|
||||
padding: constants.RSA_PKCS1_OAEP_PADDING,
|
||||
oaepHash: 'sha256',
|
||||
},
|
||||
Buffer.from(password, 'utf8')
|
||||
).toString('base64'),
|
||||
});
|
||||
Reference in New Issue
Block a user