mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-16 06:58:46 +00:00
암호 키가 등록된 클라이언트에서 로그인을 수행하는 방식을 변경된 API에 맞게 변경
우선 이메일과 비밀번호를 이용해 로그인을 수행한 후, Token Upgrade를 수행하도록 변경했습니다.
This commit is contained in:
@@ -50,7 +50,7 @@ export const makeRSAKeyNonextractable = async (key: CryptoKey, type: RSAKeyType)
|
||||
);
|
||||
};
|
||||
|
||||
export const exportRSAKey = async (key: CryptoKey, type: RSAKeyType) => {
|
||||
const exportRSAKey = async (key: CryptoKey, type: RSAKeyType) => {
|
||||
const format = type === "public" ? ("spki" as const) : ("pkcs8" as const);
|
||||
return {
|
||||
format,
|
||||
@@ -58,6 +58,10 @@ export const exportRSAKey = async (key: CryptoKey, type: RSAKeyType) => {
|
||||
};
|
||||
};
|
||||
|
||||
export const exportRSAKeyToBase64 = async (key: CryptoKey, type: RSAKeyType) => {
|
||||
return encodeToBase64((await exportRSAKey(key, type)).key);
|
||||
};
|
||||
|
||||
export const encryptRSAPlaintext = async (plaintext: ArrayBuffer, publicKey: CryptoKey) => {
|
||||
return await window.crypto.subtle.encrypt(
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user