forked from openwallet-foundation/credo-ts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(askar): improved hardware key support (openwallet-foundation#1968)
* feat(askar): improved hardware key support Signed-off-by: Berend Sliedrecht <[email protected]> * chore: resolved feedback and formatting Signed-off-by: Berend Sliedrecht <[email protected]> --------- Signed-off-by: Berend Sliedrecht <[email protected]>
- Loading branch information
1 parent
b387574
commit 1a941e7
Showing
9 changed files
with
229 additions
and
339 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export * from './secureEnvironment' |
9 changes: 9 additions & 0 deletions
9
packages/askar/src/secureEnvironment/secureEnvironment.native.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export function importSecureEnvironment() { | ||
try { | ||
// eslint-disable-next-line @typescript-eslint/no-var-requires | ||
const secureEnvironment = require('@animo-id/expo-secure-environment') | ||
return secureEnvironment | ||
} catch (error) { | ||
throw new Error('@animo-id/expo-secure-environment must be installed as a peer dependency') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
export function importSecureEnvironment(): { | ||
sign: (id: string, message: Uint8Array) => Promise<Uint8Array> | ||
getPublicBytesForKeyId: (id: string) => Uint8Array | ||
generateKeypair: (id: string) => void | ||
} { | ||
throw new Error( | ||
'@animo-id/expo-secure-environment cannot be imported in Node.js. Currently, there is no hardware key support for node.js' | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.