@zkorum/capacitor-secure-signing
v1.5.0
Published
Generate signing keys and use them securely
Readme
@zkorum/capacitor-secure-signing
Generate signing keys and use them securely.
WARNING: beta software. Only tailored for ZKorum's need for now. At this stage, API and core functionalities WILL change and WILL NOT be backward compatible.
Install
npm install @zkorum/capacitor-secure-signing
npx cap syncAPI
doesKeyPairExist(...)generateKeyPair(...)sign(...)createKeyPairIfDoesNotExist(...)deleteKeyPair(...)getKeyPair(...)
doesKeyPairExist(...)
doesKeyPairExist(options: { prefixedKey: string; }) => Promise<{ isExisting: boolean; }>| Param | Type |
| ------------- | ------------------------------------- |
| options | { prefixedKey: string; } |
Returns: Promise<{ isExisting: boolean; }>
generateKeyPair(...)
generateKeyPair(options: { prefixedKey: string; }) => Promise<{ publicKey: string; }>| Param | Type |
| ------------- | ------------------------------------- |
| options | { prefixedKey: string; } |
Returns: Promise<{ publicKey: string; }>
sign(...)
sign(options: { prefixedKey: string; data: string; }) => Promise<{ signature: string; }>| Param | Type |
| ------------- | --------------------------------------------------- |
| options | { prefixedKey: string; data: string; } |
Returns: Promise<{ signature: string; }>
createKeyPairIfDoesNotExist(...)
createKeyPairIfDoesNotExist(options: { prefixedKey: string; }) => Promise<{ publicKey: string; }>| Param | Type |
| ------------- | ------------------------------------- |
| options | { prefixedKey: string; } |
Returns: Promise<{ publicKey: string; }>
deleteKeyPair(...)
deleteKeyPair(options: { prefixedKey: string; }) => Promise<{ deleteStatus: string; }>| Param | Type |
| ------------- | ------------------------------------- |
| options | { prefixedKey: string; } |
Returns: Promise<{ deleteStatus: string; }>
getKeyPair(...)
getKeyPair(options: { prefixedKey: string; }) => Promise<{ publicKey: string; }>| Param | Type |
| ------------- | ------------------------------------- |
| options | { prefixedKey: string; } |
Returns: Promise<{ publicKey: string; }>
TODO
[x] iOS support [ ] more options for keys / security
Acknowledgements
This project has received funding from the European Union's Horizon Europe 2020 research and innovation program through the NGI TRUSTCHAIN program under cascade funding agreement No. 101093274.
The NGI TRUSTCHAIN grant mainly funded the deleteKeyPair, getKeyPair functions as well as the iOS support, as well as its general usage within Agora Citizen Network.
License
This repository is released under LICENSE.
Certain parts of code are inspired or copied from https://github.com/aparajita/capacitor-secure-storage which is MIT Licensed. Those parts are indicated in the code as comments.
