Skip to content

Commit

Permalink
refactor(encryption): ♻️ Removed unused utility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
itpropro committed Jan 2, 2024
1 parent 385798a commit edb1a72
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions src/_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,26 +91,6 @@ export interface StorageValueEnvelope {
encryptedValue: string;
}

export function generateEncryptionKey() {
return genBase64FromBytes(getRandomValues(new Uint8Array(32)));
}

export async function generateRsaKeyPair() {
const keyPair = await subtle.generateKey(
{
name: "RSA-OAEP",
modulusLength: 4096,
publicExponent: new Uint8Array([1, 0, 1]),
hash: "SHA-256",
},
true,
['encrypt', 'decrypt']);
return {
privateKey: keyPair.privateKey,
publicKey: keyPair.publicKey,
};
}

export function encryptStorageValue(storageValue: any, key: string, raw?: boolean): StorageValueEnvelope {
const cryptoKey = genBytesFromBase64(key);
const nonce = getRandomValues(new Uint8Array(24));
Expand Down

0 comments on commit edb1a72

Please sign in to comment.