@evervault/sdk
Advanced tools
Comparing version 0.3.5 to 0.3.6
@@ -8,2 +8,3 @@ /** @format */ | ||
let _privateKey = undefined; | ||
this.subtle = Utils.getSubtleCrypto(); | ||
@@ -13,3 +14,3 @@ this.encryptString = (str) => { | ||
const iv = window.crypto.getRandomValues(new Uint8Array(12)); | ||
return window.crypto.subtle | ||
return this.subtle | ||
.encrypt( | ||
@@ -34,3 +35,3 @@ { | ||
const ivBuffer = Utils.b64ToBuffer(parsedData.iv); | ||
return window.crypto.subtle | ||
return this.subtle | ||
.decrypt( | ||
@@ -37,0 +38,0 @@ { |
{ | ||
"name": "@evervault/sdk", | ||
"version": "0.3.5", | ||
"version": "0.3.6", | ||
"description": "evervault Browser SDK", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -6,3 +6,3 @@ /** @format */ | ||
const privateKeyBuffer = this.b64ToBuffer(privateKey); | ||
return window.crypto.subtle.importKey( | ||
return this.getSubtleCrypto().importKey( | ||
'raw', | ||
@@ -159,2 +159,9 @@ privateKeyBuffer, | ||
} | ||
static getSubtleCrypto() { | ||
if (!window.crypto.subtle && window.crypto.webkitSubtle) { | ||
return window.crypto.webkitSubtle; | ||
} | ||
return window.crypto.subtle; | ||
} | ||
}; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
55805
1012