Faraz
Faraz

Reputation: 99

where to store crypto key?

i am generating key pair using subtlecrypto in web crypto api in javascript, use the code below, but i want to each user only get one key pair during using web app, i mean even after refreshing or sign out the app, the key must persist, how can i save these keys securely?

    const key = await subtle.generateKey(
      {
        name: 'RSASSA-PKCS1-v1_5',
        modulusLength: 1024,
        publicExponent: new Uint8Array([1, 0, 1]),
        hash: 'SHA-256'
      },
      false,
      ['sign', 'verify'] 
    )

i expect to store keys securely, so each user only get one key during using web app, i mean persist the key during refresh or sign out, so there is no need to get a new key each time

Upvotes: 1

Views: 104

Answers (0)

Related Questions