fmt
This commit is contained in:
+4
-4
@@ -17,9 +17,9 @@ export default class PrivateBox {
|
||||
log.trace('Extractable :', extractable)
|
||||
try {
|
||||
return crypto.subtle.generateKey(consts.ECDH, extractable, ['deriveKey']) as Promise<CryptoKeyPair>
|
||||
} catch(e) {
|
||||
log.warn("Failed to generate a key")
|
||||
log.debug("Error :", e)
|
||||
} catch (e) {
|
||||
log.warn('Failed to generate a key')
|
||||
log.debug('Error :', e)
|
||||
throw e
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,7 @@ export default class PrivateBox {
|
||||
|
||||
const pubkey = await pubkey_fromString(parts[0], Usage.ecdh)
|
||||
if (pubkey === null) return null
|
||||
const box = SecretBox.fromString(parts.slice(1).join("."))
|
||||
const box = SecretBox.fromString(parts.slice(1).join('.'))
|
||||
if (box === null) return null
|
||||
|
||||
return new PrivateBox(pubkey, box)
|
||||
|
||||
Reference in New Issue
Block a user