@openwallet-foundation/askar-shared 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +191 -0
- package/README.md +44 -0
- package/build/askar/Askar.d.ts +437 -0
- package/build/askar/Askar.js +3 -0
- package/build/askar/Askar.js.map +1 -0
- package/build/askar/index.d.ts +2 -0
- package/build/askar/index.js +19 -0
- package/build/askar/index.js.map +1 -0
- package/build/askar/register.d.ts +5 -0
- package/build/askar/register.js +8 -0
- package/build/askar/register.js.map +1 -0
- package/build/crypto/AeadParams.d.ts +9 -0
- package/build/crypto/AeadParams.js +11 -0
- package/build/crypto/AeadParams.js.map +1 -0
- package/build/crypto/CryptoBox.d.ts +24 -0
- package/build/crypto/CryptoBox.js +23 -0
- package/build/crypto/CryptoBox.js.map +1 -0
- package/build/crypto/Ecdh1PU.d.ts +58 -0
- package/build/crypto/Ecdh1PU.js +77 -0
- package/build/crypto/Ecdh1PU.js.map +1 -0
- package/build/crypto/EcdhEs.d.ts +46 -0
- package/build/crypto/EcdhEs.js +64 -0
- package/build/crypto/EcdhEs.js.map +1 -0
- package/build/crypto/EncryptedBuffer.d.ts +20 -0
- package/build/crypto/EncryptedBuffer.js +36 -0
- package/build/crypto/EncryptedBuffer.js.map +1 -0
- package/build/crypto/Jwk.d.ts +18 -0
- package/build/crypto/Jwk.js +24 -0
- package/build/crypto/Jwk.js.map +1 -0
- package/build/crypto/Key.d.ts +73 -0
- package/build/crypto/Key.js +101 -0
- package/build/crypto/Key.js.map +1 -0
- package/build/crypto/handles.d.ts +46 -0
- package/build/crypto/handles.js +123 -0
- package/build/crypto/handles.js.map +1 -0
- package/build/crypto/index.d.ts +8 -0
- package/build/crypto/index.js +25 -0
- package/build/crypto/index.js.map +1 -0
- package/build/enums/EntryOperation.d.ts +5 -0
- package/build/enums/EntryOperation.js +10 -0
- package/build/enums/EntryOperation.js.map +1 -0
- package/build/enums/KeyAlgorithm.d.ts +20 -0
- package/build/enums/KeyAlgorithm.js +38 -0
- package/build/enums/KeyAlgorithm.js.map +1 -0
- package/build/enums/KeyBackend.d.ts +6 -0
- package/build/enums/KeyBackend.js +24 -0
- package/build/enums/KeyBackend.js.map +1 -0
- package/build/enums/KeyMethod.d.ts +4 -0
- package/build/enums/KeyMethod.js +9 -0
- package/build/enums/KeyMethod.js.map +1 -0
- package/build/enums/LogLevel.d.ts +9 -0
- package/build/enums/LogLevel.js +14 -0
- package/build/enums/LogLevel.js.map +1 -0
- package/build/enums/SignatureAlgorithm.d.ts +6 -0
- package/build/enums/SignatureAlgorithm.js +11 -0
- package/build/enums/SignatureAlgorithm.js.map +1 -0
- package/build/enums/index.d.ts +5 -0
- package/build/enums/index.js +22 -0
- package/build/enums/index.js.map +1 -0
- package/build/error.d.ts +12 -0
- package/build/error.js +21 -0
- package/build/error.js.map +1 -0
- package/build/index.d.ts +6 -0
- package/build/index.js +23 -0
- package/build/index.js.map +1 -0
- package/build/migration.d.ts +10 -0
- package/build/migration.js +11 -0
- package/build/migration.js.map +1 -0
- package/build/store/Entry.d.ts +21 -0
- package/build/store/Entry.js +38 -0
- package/build/store/Entry.js.map +1 -0
- package/build/store/EntryList.d.ts +17 -0
- package/build/store/EntryList.js +40 -0
- package/build/store/EntryList.js.map +1 -0
- package/build/store/KeyEntry.d.ts +23 -0
- package/build/store/KeyEntry.js +40 -0
- package/build/store/KeyEntry.js.map +1 -0
- package/build/store/KeyEntryList.d.ts +15 -0
- package/build/store/KeyEntryList.js +33 -0
- package/build/store/KeyEntryList.js.map +1 -0
- package/build/store/OpenSession.d.ts +14 -0
- package/build/store/OpenSession.js +27 -0
- package/build/store/OpenSession.js.map +1 -0
- package/build/store/Scan.d.ts +28 -0
- package/build/store/Scan.js +67 -0
- package/build/store/Scan.js.map +1 -0
- package/build/store/Session.d.ts +86 -0
- package/build/store/Session.js +182 -0
- package/build/store/Session.js.map +1 -0
- package/build/store/Store.d.ts +58 -0
- package/build/store/Store.js +87 -0
- package/build/store/Store.js.map +1 -0
- package/build/store/StoreKeyMethod.d.ts +11 -0
- package/build/store/StoreKeyMethod.js +20 -0
- package/build/store/StoreKeyMethod.js.map +1 -0
- package/build/store/index.d.ts +9 -0
- package/build/store/index.js +26 -0
- package/build/store/index.js.map +1 -0
- package/package.json +36 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
Copyright 2020 Government of British Columbia
|
|
180
|
+
|
|
181
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
182
|
+
you may not use this file except in compliance with the License.
|
|
183
|
+
You may obtain a copy of the License at
|
|
184
|
+
|
|
185
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
186
|
+
|
|
187
|
+
Unless required by applicable law or agreed to in writing, software
|
|
188
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
189
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
190
|
+
See the License for the specific language governing permissions and
|
|
191
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# Askar Shared
|
|
2
|
+
|
|
3
|
+
This package does not contain any functionality, just the classes and types that wrap around the native NodeJS / React Native functionality
|
|
4
|
+
|
|
5
|
+
## Platform independent setup
|
|
6
|
+
|
|
7
|
+
If you would like to leverage the Askar libraries for JavaScript in a platform independent way you need to add the `@openwallet-foundation/askar-shared` package to your project. This package exports all public methods.
|
|
8
|
+
|
|
9
|
+
Before calling any methods you then need to make sure you register the platform specific native bindings. You can do this by importing the platform specific package. You can do this by having separate files that register the package, which allows the React Native bundler to import a different package:
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
// register.ts
|
|
13
|
+
import '@openwallet-foundation/askar-nodejs'
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
// register.native.ts
|
|
18
|
+
import '@openwallet-foundation/askar-react-native'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
An alterative approach is to first try to require the Node.JS package, and otherwise require the React Native package:
|
|
22
|
+
|
|
23
|
+
```typescript
|
|
24
|
+
try {
|
|
25
|
+
require('@openwallet-foundation/askar-nodejs')
|
|
26
|
+
} catch (error) {
|
|
27
|
+
try {
|
|
28
|
+
require('@openwallet-foundation/askar-react-native')
|
|
29
|
+
} catch (error) {
|
|
30
|
+
throw new Error('Could not load Askar bindings')
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
How you approach it is up to you, as long as the native binding are called before any actions are performed on the Askar library.
|
|
36
|
+
|
|
37
|
+
## Version Compatibility
|
|
38
|
+
|
|
39
|
+
The JavaScript wrapper is versioned independently from the native bindings. The following table shows the compatibility between the different versions:
|
|
40
|
+
|
|
41
|
+
| Askar | JavaScript Wrapper |
|
|
42
|
+
| ----------- | ------------------ |
|
|
43
|
+
| v0.2.9 | v0.1.0, v0.1.1 |
|
|
44
|
+
| v0.3.1 | v0.2.0 |
|
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
import type { AeadParams, EncryptedBuffer, EntryListHandle, Jwk, Key, KeyEntryListHandle, LocalKeyHandle, ScanHandle, SessionHandle, StoreHandle } from '../crypto';
|
|
2
|
+
import type { KeyAlgorithm, KeyBackend, LogLevel, SignatureAlgorithm } from '../enums';
|
|
3
|
+
import type { AskarErrorObject } from '../error';
|
|
4
|
+
export type ErrorCode = number;
|
|
5
|
+
export type NativeLogCallback = (context: unknown, level: number, target: string, message: string, modulePath: string, file: string, line: number) => void;
|
|
6
|
+
export type SetCustomLoggerOptions = {
|
|
7
|
+
logLevel: LogLevel;
|
|
8
|
+
flush?: boolean;
|
|
9
|
+
enabled?: boolean;
|
|
10
|
+
logger: NativeLogCallback;
|
|
11
|
+
};
|
|
12
|
+
export type SetMaxLogLevelOptions = {
|
|
13
|
+
logLevel: number;
|
|
14
|
+
};
|
|
15
|
+
export type EntryListCountOptions = {
|
|
16
|
+
entryListHandle: EntryListHandle;
|
|
17
|
+
};
|
|
18
|
+
export type EntryListFreeOptions = {
|
|
19
|
+
entryListHandle: EntryListHandle;
|
|
20
|
+
};
|
|
21
|
+
export type EntryListGetCategoryOptions = {
|
|
22
|
+
entryListHandle: EntryListHandle;
|
|
23
|
+
index: number;
|
|
24
|
+
};
|
|
25
|
+
export type EntryListGetNameOptions = {
|
|
26
|
+
entryListHandle: EntryListHandle;
|
|
27
|
+
index: number;
|
|
28
|
+
};
|
|
29
|
+
export type EntryListGetTagsOptions = {
|
|
30
|
+
entryListHandle: EntryListHandle;
|
|
31
|
+
index: number;
|
|
32
|
+
};
|
|
33
|
+
export type EntryListGetValueOptions = {
|
|
34
|
+
entryListHandle: EntryListHandle;
|
|
35
|
+
index: number;
|
|
36
|
+
};
|
|
37
|
+
export type KeyAeadDecryptOptions = {
|
|
38
|
+
localKeyHandle: LocalKeyHandle;
|
|
39
|
+
ciphertext: Uint8Array;
|
|
40
|
+
nonce: Uint8Array;
|
|
41
|
+
tag?: Uint8Array;
|
|
42
|
+
aad?: Uint8Array;
|
|
43
|
+
};
|
|
44
|
+
export type KeyAeadEncryptOptions = {
|
|
45
|
+
localKeyHandle: LocalKeyHandle;
|
|
46
|
+
message: Uint8Array;
|
|
47
|
+
nonce?: Uint8Array;
|
|
48
|
+
aad?: Uint8Array;
|
|
49
|
+
};
|
|
50
|
+
export type KeyAeadGetPaddingOptions = {
|
|
51
|
+
localKeyHandle: LocalKeyHandle;
|
|
52
|
+
msgLen: number;
|
|
53
|
+
};
|
|
54
|
+
export type KeyAeadGetParamsOptions = {
|
|
55
|
+
localKeyHandle: LocalKeyHandle;
|
|
56
|
+
};
|
|
57
|
+
export type KeyAeadRandomNonceOptions = {
|
|
58
|
+
localKeyHandle: LocalKeyHandle;
|
|
59
|
+
};
|
|
60
|
+
export type KeyConvertOptions = {
|
|
61
|
+
localKeyHandle: LocalKeyHandle;
|
|
62
|
+
algorithm: KeyAlgorithm;
|
|
63
|
+
};
|
|
64
|
+
export type KeyCryptoBoxOptions = {
|
|
65
|
+
recipientKey: Key;
|
|
66
|
+
senderKey: Key;
|
|
67
|
+
message: Uint8Array;
|
|
68
|
+
nonce: Uint8Array;
|
|
69
|
+
};
|
|
70
|
+
export type KeyCryptoBoxOpenOptions = {
|
|
71
|
+
recipientKey: Key;
|
|
72
|
+
senderKey: Key;
|
|
73
|
+
message: Uint8Array;
|
|
74
|
+
nonce: Uint8Array;
|
|
75
|
+
};
|
|
76
|
+
export type KeyCryptoBoxSealOptions = {
|
|
77
|
+
localKeyHandle: LocalKeyHandle;
|
|
78
|
+
message: Uint8Array;
|
|
79
|
+
};
|
|
80
|
+
export type KeyCryptoBoxSealOpenOptions = {
|
|
81
|
+
localKeyHandle: LocalKeyHandle;
|
|
82
|
+
ciphertext: Uint8Array;
|
|
83
|
+
};
|
|
84
|
+
export type KeyDeriveEcdh1puOptions = {
|
|
85
|
+
algorithm: KeyAlgorithm;
|
|
86
|
+
ephemeralKey: Key;
|
|
87
|
+
senderKey: Key;
|
|
88
|
+
recipientKey: Key;
|
|
89
|
+
algId: Uint8Array;
|
|
90
|
+
apu: Uint8Array;
|
|
91
|
+
apv: Uint8Array;
|
|
92
|
+
ccTag?: Uint8Array;
|
|
93
|
+
receive: boolean;
|
|
94
|
+
};
|
|
95
|
+
export type KeyDeriveEcdhEsOptions = {
|
|
96
|
+
algorithm: KeyAlgorithm;
|
|
97
|
+
ephemeralKey: Key;
|
|
98
|
+
recipientKey: Key;
|
|
99
|
+
algId: Uint8Array;
|
|
100
|
+
apu: Uint8Array;
|
|
101
|
+
apv: Uint8Array;
|
|
102
|
+
receive: boolean;
|
|
103
|
+
};
|
|
104
|
+
export type KeyEntryListCountOptions = {
|
|
105
|
+
keyEntryListHandle: KeyEntryListHandle;
|
|
106
|
+
};
|
|
107
|
+
export type KeyEntryListFreeOptions = {
|
|
108
|
+
keyEntryListHandle: KeyEntryListHandle;
|
|
109
|
+
};
|
|
110
|
+
export type KeyEntryListGetAlgorithmOptions = {
|
|
111
|
+
keyEntryListHandle: KeyEntryListHandle;
|
|
112
|
+
index: number;
|
|
113
|
+
};
|
|
114
|
+
export type KeyEntryListGetMetadataOptions = {
|
|
115
|
+
keyEntryListHandle: KeyEntryListHandle;
|
|
116
|
+
index: number;
|
|
117
|
+
};
|
|
118
|
+
export type KeyEntryListGetNameOptions = {
|
|
119
|
+
keyEntryListHandle: KeyEntryListHandle;
|
|
120
|
+
index: number;
|
|
121
|
+
};
|
|
122
|
+
export type KeyEntryListGetTagsOptions = {
|
|
123
|
+
keyEntryListHandle: KeyEntryListHandle;
|
|
124
|
+
index: number;
|
|
125
|
+
};
|
|
126
|
+
export type KeyEntryListLoadLocalOptions = {
|
|
127
|
+
keyEntryListHandle: KeyEntryListHandle;
|
|
128
|
+
index: number;
|
|
129
|
+
};
|
|
130
|
+
export type KeyFreeOptions = {
|
|
131
|
+
localKeyHandle: LocalKeyHandle;
|
|
132
|
+
};
|
|
133
|
+
export type KeyFromJwkOptions = {
|
|
134
|
+
jwk: Jwk;
|
|
135
|
+
};
|
|
136
|
+
export type KeyFromKeyExchangeOptions = {
|
|
137
|
+
algorithm: KeyAlgorithm;
|
|
138
|
+
skHandle: LocalKeyHandle;
|
|
139
|
+
pkHandle: LocalKeyHandle;
|
|
140
|
+
};
|
|
141
|
+
export type KeyFromPublicBytesOptions = {
|
|
142
|
+
algorithm: KeyAlgorithm;
|
|
143
|
+
publicKey: Uint8Array;
|
|
144
|
+
};
|
|
145
|
+
export type KeyFromSecretBytesOptions = {
|
|
146
|
+
algorithm: KeyAlgorithm;
|
|
147
|
+
secretKey: Uint8Array;
|
|
148
|
+
};
|
|
149
|
+
export type KeyFromSeedOptions = {
|
|
150
|
+
algorithm: KeyAlgorithm;
|
|
151
|
+
seed: Uint8Array;
|
|
152
|
+
method: string;
|
|
153
|
+
};
|
|
154
|
+
export type KeyGenerateOptions = {
|
|
155
|
+
algorithm: KeyAlgorithm;
|
|
156
|
+
keyBackend?: KeyBackend;
|
|
157
|
+
ephemeral: boolean;
|
|
158
|
+
};
|
|
159
|
+
export type KeyGetAlgorithmOptions = {
|
|
160
|
+
localKeyHandle: LocalKeyHandle;
|
|
161
|
+
};
|
|
162
|
+
export type KeyGetEphemeralOptions = {
|
|
163
|
+
localKeyHandle: LocalKeyHandle;
|
|
164
|
+
};
|
|
165
|
+
export type KeyGetJwkPublicOptions = {
|
|
166
|
+
localKeyHandle: LocalKeyHandle;
|
|
167
|
+
algorithm: string;
|
|
168
|
+
};
|
|
169
|
+
export type KeyGetJwkSecretOptions = {
|
|
170
|
+
localKeyHandle: LocalKeyHandle;
|
|
171
|
+
};
|
|
172
|
+
export type KeyGetJwkThumbprintOptions = {
|
|
173
|
+
localKeyHandle: LocalKeyHandle;
|
|
174
|
+
algorithm: string;
|
|
175
|
+
};
|
|
176
|
+
export type KeyGetPublicBytesOptions = {
|
|
177
|
+
localKeyHandle: LocalKeyHandle;
|
|
178
|
+
};
|
|
179
|
+
export type KeyGetSecretBytesOptions = {
|
|
180
|
+
localKeyHandle: LocalKeyHandle;
|
|
181
|
+
};
|
|
182
|
+
export type KeySignMessageOptions = {
|
|
183
|
+
localKeyHandle: LocalKeyHandle;
|
|
184
|
+
message: Uint8Array;
|
|
185
|
+
sigType?: SignatureAlgorithm;
|
|
186
|
+
};
|
|
187
|
+
export type KeyUnwrapKeyOptions = {
|
|
188
|
+
localKeyHandle: LocalKeyHandle;
|
|
189
|
+
algorithm: KeyAlgorithm;
|
|
190
|
+
ciphertext: Uint8Array;
|
|
191
|
+
nonce?: Uint8Array;
|
|
192
|
+
tag?: Uint8Array;
|
|
193
|
+
};
|
|
194
|
+
export type KeyVerifySignatureOptions = {
|
|
195
|
+
localKeyHandle: LocalKeyHandle;
|
|
196
|
+
message: Uint8Array;
|
|
197
|
+
signature: Uint8Array;
|
|
198
|
+
sigType?: SignatureAlgorithm;
|
|
199
|
+
};
|
|
200
|
+
export type KeyWrapKeyOptions = {
|
|
201
|
+
localKeyHandle: LocalKeyHandle;
|
|
202
|
+
other: LocalKeyHandle;
|
|
203
|
+
nonce?: Uint8Array;
|
|
204
|
+
};
|
|
205
|
+
export type ScanFreeOptions = {
|
|
206
|
+
scanHandle: ScanHandle;
|
|
207
|
+
};
|
|
208
|
+
export type ScanNextOptions = {
|
|
209
|
+
scanHandle: ScanHandle;
|
|
210
|
+
};
|
|
211
|
+
export type ScanStartOptions = {
|
|
212
|
+
storeHandle: StoreHandle;
|
|
213
|
+
category: string;
|
|
214
|
+
profile?: string;
|
|
215
|
+
tagFilter?: Record<string, unknown>;
|
|
216
|
+
offset?: number;
|
|
217
|
+
limit?: number;
|
|
218
|
+
orderBy?: string;
|
|
219
|
+
descending?: boolean;
|
|
220
|
+
};
|
|
221
|
+
export type SessionCloseOptions = {
|
|
222
|
+
sessionHandle: SessionHandle;
|
|
223
|
+
commit: boolean;
|
|
224
|
+
};
|
|
225
|
+
export type SessionCountOptions = {
|
|
226
|
+
sessionHandle: SessionHandle;
|
|
227
|
+
category: string;
|
|
228
|
+
tagFilter?: Record<string, unknown>;
|
|
229
|
+
};
|
|
230
|
+
export type SessionFetchOptions = {
|
|
231
|
+
sessionHandle: SessionHandle;
|
|
232
|
+
category: string;
|
|
233
|
+
name: string;
|
|
234
|
+
forUpdate: boolean;
|
|
235
|
+
};
|
|
236
|
+
export type SessionFetchAllOptions = {
|
|
237
|
+
sessionHandle: SessionHandle;
|
|
238
|
+
category: string;
|
|
239
|
+
tagFilter?: Record<string, unknown>;
|
|
240
|
+
limit?: number;
|
|
241
|
+
orderBy?: string;
|
|
242
|
+
descending?: boolean;
|
|
243
|
+
forUpdate: boolean;
|
|
244
|
+
};
|
|
245
|
+
export type SessionFetchAllKeysOptions = {
|
|
246
|
+
sessionHandle: SessionHandle;
|
|
247
|
+
forUpdate: boolean;
|
|
248
|
+
algorithm?: string;
|
|
249
|
+
thumbprint?: string;
|
|
250
|
+
tagFilter?: Record<string, unknown>;
|
|
251
|
+
limit?: number;
|
|
252
|
+
};
|
|
253
|
+
export type SessionFetchKeyOptions = {
|
|
254
|
+
sessionHandle: SessionHandle;
|
|
255
|
+
name: string;
|
|
256
|
+
forUpdate: boolean;
|
|
257
|
+
};
|
|
258
|
+
export type SessionInsertKeyOptions = {
|
|
259
|
+
sessionHandle: SessionHandle;
|
|
260
|
+
localKeyHandle: LocalKeyHandle;
|
|
261
|
+
name: string;
|
|
262
|
+
metadata?: string;
|
|
263
|
+
tags?: Record<string, unknown>;
|
|
264
|
+
expiryMs?: number;
|
|
265
|
+
};
|
|
266
|
+
export type SessionRemoveAllOptions = {
|
|
267
|
+
sessionHandle: SessionHandle;
|
|
268
|
+
category: string;
|
|
269
|
+
tagFilter?: Record<string, unknown>;
|
|
270
|
+
};
|
|
271
|
+
export type SessionRemoveKeyOptions = {
|
|
272
|
+
sessionHandle: SessionHandle;
|
|
273
|
+
name: string;
|
|
274
|
+
};
|
|
275
|
+
export type SessionStartOptions = {
|
|
276
|
+
storeHandle: StoreHandle;
|
|
277
|
+
profile?: string;
|
|
278
|
+
asTransaction: boolean;
|
|
279
|
+
};
|
|
280
|
+
export type SessionUpdateOptions = {
|
|
281
|
+
sessionHandle: SessionHandle;
|
|
282
|
+
operation: number;
|
|
283
|
+
category: string;
|
|
284
|
+
name: string;
|
|
285
|
+
value?: Uint8Array;
|
|
286
|
+
tags?: Record<string, unknown>;
|
|
287
|
+
expiryMs?: number;
|
|
288
|
+
};
|
|
289
|
+
export type SessionUpdateKeyOptions = {
|
|
290
|
+
sessionHandle: SessionHandle;
|
|
291
|
+
name: string;
|
|
292
|
+
metadata?: string;
|
|
293
|
+
tags?: Record<string, unknown>;
|
|
294
|
+
expiryMs?: number;
|
|
295
|
+
};
|
|
296
|
+
export type StoreCloseOptions = {
|
|
297
|
+
storeHandle: StoreHandle;
|
|
298
|
+
};
|
|
299
|
+
export type StoreCopyToOptions = {
|
|
300
|
+
storeHandle: StoreHandle;
|
|
301
|
+
targetUri: string;
|
|
302
|
+
keyMethod?: string;
|
|
303
|
+
passKey?: string;
|
|
304
|
+
recreate?: boolean;
|
|
305
|
+
};
|
|
306
|
+
export type StoreCreateProfileOptions = {
|
|
307
|
+
storeHandle: StoreHandle;
|
|
308
|
+
profile?: string;
|
|
309
|
+
};
|
|
310
|
+
export type StoreGenerateRawKeyOptions = {
|
|
311
|
+
seed?: Uint8Array;
|
|
312
|
+
};
|
|
313
|
+
export type StoreGetProfileNameOptions = {
|
|
314
|
+
storeHandle: StoreHandle;
|
|
315
|
+
};
|
|
316
|
+
export type StoreGetDefaultProfileOptions = {
|
|
317
|
+
storeHandle: StoreHandle;
|
|
318
|
+
};
|
|
319
|
+
export type StoreListProfilesOptions = {
|
|
320
|
+
storeHandle: StoreHandle;
|
|
321
|
+
};
|
|
322
|
+
export type StoreOpenOptions = {
|
|
323
|
+
specUri: string;
|
|
324
|
+
keyMethod?: string;
|
|
325
|
+
passKey?: string;
|
|
326
|
+
profile?: string;
|
|
327
|
+
};
|
|
328
|
+
export type StoreProvisionOptions = {
|
|
329
|
+
specUri: string;
|
|
330
|
+
keyMethod?: string;
|
|
331
|
+
passKey?: string;
|
|
332
|
+
profile?: string;
|
|
333
|
+
recreate: boolean;
|
|
334
|
+
};
|
|
335
|
+
export type StoreRekeyOptions = {
|
|
336
|
+
storeHandle: StoreHandle;
|
|
337
|
+
keyMethod?: string;
|
|
338
|
+
passKey: string;
|
|
339
|
+
};
|
|
340
|
+
export type StoreRemoveOptions = {
|
|
341
|
+
specUri: string;
|
|
342
|
+
};
|
|
343
|
+
export type StoreRemoveProfileOptions = {
|
|
344
|
+
storeHandle: StoreHandle;
|
|
345
|
+
profile: string;
|
|
346
|
+
};
|
|
347
|
+
export type StoreSetDefaultProfileOptions = {
|
|
348
|
+
storeHandle: StoreHandle;
|
|
349
|
+
profile: string;
|
|
350
|
+
};
|
|
351
|
+
export type MigrateIndySdkOptions = {
|
|
352
|
+
specUri: string;
|
|
353
|
+
walletName: string;
|
|
354
|
+
walletKey: string;
|
|
355
|
+
kdfLevel: string;
|
|
356
|
+
};
|
|
357
|
+
export type Askar = {
|
|
358
|
+
version(): string;
|
|
359
|
+
getCurrentError(): AskarErrorObject;
|
|
360
|
+
clearCustomLogger(): void;
|
|
361
|
+
setCustomLogger(options: SetCustomLoggerOptions): void;
|
|
362
|
+
setDefaultLogger(): void;
|
|
363
|
+
setMaxLogLevel(options: SetMaxLogLevelOptions): void;
|
|
364
|
+
entryListCount(options: EntryListCountOptions): number;
|
|
365
|
+
entryListFree(options: EntryListFreeOptions): void;
|
|
366
|
+
entryListGetCategory(options: EntryListGetCategoryOptions): string;
|
|
367
|
+
entryListGetName(options: EntryListGetNameOptions): string;
|
|
368
|
+
entryListGetTags(options: EntryListGetTagsOptions): string | null;
|
|
369
|
+
entryListGetValue(options: EntryListGetValueOptions): Uint8Array;
|
|
370
|
+
keyAeadDecrypt(options: KeyAeadDecryptOptions): Uint8Array;
|
|
371
|
+
keyAeadEncrypt(options: KeyAeadEncryptOptions): EncryptedBuffer;
|
|
372
|
+
keyAeadGetPadding(options: KeyAeadGetPaddingOptions): number;
|
|
373
|
+
keyAeadGetParams(options: KeyAeadGetParamsOptions): AeadParams;
|
|
374
|
+
keyAeadRandomNonce(options: KeyAeadRandomNonceOptions): Uint8Array;
|
|
375
|
+
keyConvert(options: KeyConvertOptions): LocalKeyHandle;
|
|
376
|
+
keyCryptoBox(options: KeyCryptoBoxOptions): Uint8Array;
|
|
377
|
+
keyCryptoBoxOpen(options: KeyCryptoBoxOpenOptions): Uint8Array;
|
|
378
|
+
keyCryptoBoxRandomNonce(): Uint8Array;
|
|
379
|
+
keyCryptoBoxSeal(options: KeyCryptoBoxSealOptions): Uint8Array;
|
|
380
|
+
keyCryptoBoxSealOpen(options: KeyCryptoBoxSealOpenOptions): Uint8Array;
|
|
381
|
+
keyDeriveEcdh1pu(options: KeyDeriveEcdh1puOptions): LocalKeyHandle;
|
|
382
|
+
keyDeriveEcdhEs(options: KeyDeriveEcdhEsOptions): LocalKeyHandle;
|
|
383
|
+
keyEntryListCount(options: KeyEntryListCountOptions): number;
|
|
384
|
+
keyEntryListFree(options: KeyEntryListFreeOptions): void;
|
|
385
|
+
keyEntryListGetAlgorithm(options: KeyEntryListGetAlgorithmOptions): string;
|
|
386
|
+
keyEntryListGetMetadata(options: KeyEntryListGetMetadataOptions): string | null;
|
|
387
|
+
keyEntryListGetName(options: KeyEntryListGetNameOptions): string;
|
|
388
|
+
keyEntryListGetTags(options: KeyEntryListGetTagsOptions): string | null;
|
|
389
|
+
keyEntryListLoadLocal(options: KeyEntryListLoadLocalOptions): LocalKeyHandle;
|
|
390
|
+
keyFree(options: KeyFreeOptions): void;
|
|
391
|
+
keyFromJwk(options: KeyFromJwkOptions): LocalKeyHandle;
|
|
392
|
+
keyFromKeyExchange(options: KeyFromKeyExchangeOptions): LocalKeyHandle;
|
|
393
|
+
keyFromPublicBytes(options: KeyFromPublicBytesOptions): LocalKeyHandle;
|
|
394
|
+
keyFromSecretBytes(options: KeyFromSecretBytesOptions): LocalKeyHandle;
|
|
395
|
+
keyFromSeed(options: KeyFromSeedOptions): LocalKeyHandle;
|
|
396
|
+
keyGenerate(options: KeyGenerateOptions): LocalKeyHandle;
|
|
397
|
+
keyGetAlgorithm(options: KeyGetAlgorithmOptions): string;
|
|
398
|
+
keyGetEphemeral(options: KeyGetEphemeralOptions): number;
|
|
399
|
+
keyGetJwkPublic(options: KeyGetJwkPublicOptions): string;
|
|
400
|
+
keyGetJwkSecret(options: KeyGetJwkSecretOptions): Uint8Array;
|
|
401
|
+
keyGetJwkThumbprint(options: KeyGetJwkThumbprintOptions): string;
|
|
402
|
+
keyGetPublicBytes(options: KeyGetPublicBytesOptions): Uint8Array;
|
|
403
|
+
keyGetSecretBytes(options: KeyGetSecretBytesOptions): Uint8Array;
|
|
404
|
+
keySignMessage(options: KeySignMessageOptions): Uint8Array;
|
|
405
|
+
keyUnwrapKey(options: KeyUnwrapKeyOptions): LocalKeyHandle;
|
|
406
|
+
keyVerifySignature(options: KeyVerifySignatureOptions): boolean;
|
|
407
|
+
keyWrapKey(options: KeyWrapKeyOptions): EncryptedBuffer;
|
|
408
|
+
scanFree(options: ScanFreeOptions): void;
|
|
409
|
+
scanNext(options: ScanNextOptions): Promise<EntryListHandle | null>;
|
|
410
|
+
scanStart(options: ScanStartOptions): Promise<ScanHandle>;
|
|
411
|
+
sessionClose(options: SessionCloseOptions): Promise<void>;
|
|
412
|
+
sessionCount(options: SessionCountOptions): Promise<number>;
|
|
413
|
+
sessionFetch(options: SessionFetchOptions): Promise<EntryListHandle | null>;
|
|
414
|
+
sessionFetchAll(options: SessionFetchAllOptions): Promise<EntryListHandle | null>;
|
|
415
|
+
sessionFetchAllKeys(options: SessionFetchAllKeysOptions): Promise<KeyEntryListHandle | null>;
|
|
416
|
+
sessionFetchKey(options: SessionFetchKeyOptions): Promise<KeyEntryListHandle | null>;
|
|
417
|
+
sessionInsertKey(options: SessionInsertKeyOptions): Promise<void>;
|
|
418
|
+
sessionRemoveAll(options: SessionRemoveAllOptions): Promise<number>;
|
|
419
|
+
sessionRemoveKey(options: SessionRemoveKeyOptions): Promise<void>;
|
|
420
|
+
sessionStart(options: SessionStartOptions): Promise<SessionHandle>;
|
|
421
|
+
sessionUpdate(options: SessionUpdateOptions): Promise<void>;
|
|
422
|
+
sessionUpdateKey(options: SessionUpdateKeyOptions): Promise<void>;
|
|
423
|
+
storeClose(options: StoreCloseOptions): Promise<void>;
|
|
424
|
+
storeCopyTo(options: StoreCopyToOptions): Promise<void>;
|
|
425
|
+
storeCreateProfile(options: StoreCreateProfileOptions): Promise<string>;
|
|
426
|
+
storeGenerateRawKey(options: StoreGenerateRawKeyOptions): string;
|
|
427
|
+
storeGetDefaultProfile(options: StoreGetDefaultProfileOptions): Promise<string>;
|
|
428
|
+
storeGetProfileName(options: StoreGetProfileNameOptions): Promise<string>;
|
|
429
|
+
storeListProfiles(options: StoreListProfilesOptions): Promise<string[]>;
|
|
430
|
+
storeOpen(options: StoreOpenOptions): Promise<StoreHandle>;
|
|
431
|
+
storeProvision(options: StoreProvisionOptions): Promise<StoreHandle>;
|
|
432
|
+
storeRekey(options: StoreRekeyOptions): Promise<void>;
|
|
433
|
+
storeRemove(options: StoreRemoveOptions): Promise<number>;
|
|
434
|
+
storeRemoveProfile(options: StoreRemoveProfileOptions): Promise<number>;
|
|
435
|
+
storeSetDefaultProfile(options: StoreSetDefaultProfileOptions): Promise<void>;
|
|
436
|
+
migrateIndySdk(options: MigrateIndySdkOptions): Promise<void>;
|
|
437
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Askar.js","sourceRoot":"","sources":["../../src/askar/Askar.ts"],"names":[],"mappings":""}
|