mirror of
https://github.com/kmc7468/arkvault.git
synced 2025-12-15 22:38:47 +00:00
Token Refresh/Upgrade와 관련된 DB 제약 위반 수정
This commit is contained in:
@@ -36,7 +36,7 @@ export const generateRSASigKeyPair = async () => {
|
||||
return keyPair;
|
||||
};
|
||||
|
||||
export const makeRSAKeyNonextractable = async (key: CryptoKey, type: RSAKeyType) => {
|
||||
export const makeRSAEncKeyNonextractable = async (key: CryptoKey, type: RSAKeyType) => {
|
||||
const { format, key: exportedKey } = await exportRSAKey(key, type);
|
||||
return await window.crypto.subtle.importKey(
|
||||
format,
|
||||
@@ -50,6 +50,20 @@ export const makeRSAKeyNonextractable = async (key: CryptoKey, type: RSAKeyType)
|
||||
);
|
||||
};
|
||||
|
||||
export const makeRSASigKeyNonextractable = async (key: CryptoKey, type: RSAKeyType) => {
|
||||
const { format, key: exportedKey } = await exportRSAKey(key, type);
|
||||
return await window.crypto.subtle.importKey(
|
||||
format,
|
||||
exportedKey,
|
||||
{
|
||||
name: "RSA-PSS",
|
||||
hash: "SHA-256",
|
||||
} satisfies RsaHashedImportParams,
|
||||
false,
|
||||
[type === "public" ? "verify" : "sign"],
|
||||
);
|
||||
};
|
||||
|
||||
const exportRSAKey = async (key: CryptoKey, type: RSAKeyType) => {
|
||||
const format = type === "public" ? ("spki" as const) : ("pkcs8" as const);
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user