@libp2p/keychain 4.1.5 → 4.1.6
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/dist/src/index.d.ts +18 -18
- package/package.json +1 -1
- package/src/index.ts +18 -18
package/dist/src/index.d.ts
CHANGED
|
@@ -84,8 +84,8 @@ export interface Keychain {
|
|
|
84
84
|
* @example
|
|
85
85
|
*
|
|
86
86
|
* ```TypeScript
|
|
87
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
88
|
-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
|
|
87
|
+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
88
|
+
* const pemKey = await libp2p.services.keychain.exportKey('keyTest', 'password123')
|
|
89
89
|
* ```
|
|
90
90
|
*/
|
|
91
91
|
exportKey(name: string, password: string): Promise<Multibase<'m'>>;
|
|
@@ -95,9 +95,9 @@ export interface Keychain {
|
|
|
95
95
|
* @example
|
|
96
96
|
*
|
|
97
97
|
* ```TypeScript
|
|
98
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
99
|
-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
|
|
100
|
-
* const keyInfo = await libp2p.keychain.importKey('keyTestImport', pemKey, 'password123')
|
|
98
|
+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
99
|
+
* const pemKey = await libp2p.services.keychain.exportKey('keyTest', 'password123')
|
|
100
|
+
* const keyInfo = await libp2p.services.keychain.importKey('keyTestImport', pemKey, 'password123')
|
|
101
101
|
* ```
|
|
102
102
|
*/
|
|
103
103
|
importKey(name: string, pem: string, password: string): Promise<KeyInfo>;
|
|
@@ -107,7 +107,7 @@ export interface Keychain {
|
|
|
107
107
|
* @example
|
|
108
108
|
*
|
|
109
109
|
* ```TypeScript
|
|
110
|
-
* const keyInfo = await libp2p.keychain.importPeer('keyTestImport', peerIdFromString('12D3Foo...'))
|
|
110
|
+
* const keyInfo = await libp2p.services.keychain.importPeer('keyTestImport', peerIdFromString('12D3Foo...'))
|
|
111
111
|
* ```
|
|
112
112
|
*/
|
|
113
113
|
importPeer(name: string, peerId: PeerId): Promise<KeyInfo>;
|
|
@@ -117,7 +117,7 @@ export interface Keychain {
|
|
|
117
117
|
* @example
|
|
118
118
|
*
|
|
119
119
|
* ```TypeScript
|
|
120
|
-
* const peerId = await libp2p.keychain.exportPeerId('key-name')
|
|
120
|
+
* const peerId = await libp2p.services.keychain.exportPeerId('key-name')
|
|
121
121
|
* ```
|
|
122
122
|
*/
|
|
123
123
|
exportPeerId(name: string): Promise<PeerId>;
|
|
@@ -127,7 +127,7 @@ export interface Keychain {
|
|
|
127
127
|
* @example
|
|
128
128
|
*
|
|
129
129
|
* ```TypeScript
|
|
130
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
130
|
+
* const keyInfo = await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
131
131
|
* ```
|
|
132
132
|
*/
|
|
133
133
|
createKey(name: string, type: KeyType, size?: number): Promise<KeyInfo>;
|
|
@@ -137,7 +137,7 @@ export interface Keychain {
|
|
|
137
137
|
* @example
|
|
138
138
|
*
|
|
139
139
|
* ```TypeScript
|
|
140
|
-
* const keyInfos = await libp2p.keychain.listKeys()
|
|
140
|
+
* const keyInfos = await libp2p.services.keychain.listKeys()
|
|
141
141
|
* ```
|
|
142
142
|
*/
|
|
143
143
|
listKeys(): Promise<KeyInfo[]>;
|
|
@@ -147,8 +147,8 @@ export interface Keychain {
|
|
|
147
147
|
* @example
|
|
148
148
|
*
|
|
149
149
|
* ```TypeScript
|
|
150
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
151
|
-
* const keyInfo = await libp2p.keychain.removeKey('keyTest')
|
|
150
|
+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
151
|
+
* const keyInfo = await libp2p.services.keychain.removeKey('keyTest')
|
|
152
152
|
* ```
|
|
153
153
|
*/
|
|
154
154
|
removeKey(name: string): Promise<KeyInfo>;
|
|
@@ -158,8 +158,8 @@ export interface Keychain {
|
|
|
158
158
|
* @example
|
|
159
159
|
*
|
|
160
160
|
* ```TypeScript
|
|
161
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
162
|
-
* const keyInfo = await libp2p.keychain.renameKey('keyTest', 'keyNewNtest')
|
|
161
|
+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
162
|
+
* const keyInfo = await libp2p.services.keychain.renameKey('keyTest', 'keyNewNtest')
|
|
163
163
|
* ```
|
|
164
164
|
*/
|
|
165
165
|
renameKey(oldName: string, newName: string): Promise<KeyInfo>;
|
|
@@ -169,8 +169,8 @@ export interface Keychain {
|
|
|
169
169
|
* @example
|
|
170
170
|
*
|
|
171
171
|
* ```TypeScript
|
|
172
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
173
|
-
* const keyInfo2 = await libp2p.keychain.findKeyById(keyInfo.id)
|
|
172
|
+
* const keyInfo = await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
173
|
+
* const keyInfo2 = await libp2p.services.keychain.findKeyById(keyInfo.id)
|
|
174
174
|
* ```
|
|
175
175
|
*/
|
|
176
176
|
findKeyById(id: string): Promise<KeyInfo>;
|
|
@@ -180,8 +180,8 @@ export interface Keychain {
|
|
|
180
180
|
* @example
|
|
181
181
|
*
|
|
182
182
|
* ```TypeScript
|
|
183
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
184
|
-
* const keyInfo2 = await libp2p.keychain.findKeyByName('keyTest')
|
|
183
|
+
* const keyInfo = await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
184
|
+
* const keyInfo2 = await libp2p.services.keychain.findKeyByName('keyTest')
|
|
185
185
|
* ```
|
|
186
186
|
*/
|
|
187
187
|
findKeyByName(name: string): Promise<KeyInfo>;
|
|
@@ -191,7 +191,7 @@ export interface Keychain {
|
|
|
191
191
|
* @example
|
|
192
192
|
*
|
|
193
193
|
* ```TypeScript
|
|
194
|
-
* await libp2p.keychain.rotateKeychainPass('oldPassword', 'newPassword')
|
|
194
|
+
* await libp2p.services.keychain.rotateKeychainPass('oldPassword', 'newPassword')
|
|
195
195
|
* ```
|
|
196
196
|
*/
|
|
197
197
|
rotateKeychainPass(oldPass: string, newPass: string): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/keychain",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.6",
|
|
4
4
|
"description": "Key management and cryptographically protected messages",
|
|
5
5
|
"license": "Apache-2.0 OR MIT",
|
|
6
6
|
"homepage": "https://github.com/libp2p/js-libp2p/tree/main/packages/keychain#readme",
|
package/src/index.ts
CHANGED
|
@@ -92,8 +92,8 @@ export interface Keychain {
|
|
|
92
92
|
* @example
|
|
93
93
|
*
|
|
94
94
|
* ```TypeScript
|
|
95
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
96
|
-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
|
|
95
|
+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
96
|
+
* const pemKey = await libp2p.services.keychain.exportKey('keyTest', 'password123')
|
|
97
97
|
* ```
|
|
98
98
|
*/
|
|
99
99
|
exportKey(name: string, password: string): Promise<Multibase<'m'>>
|
|
@@ -104,9 +104,9 @@ export interface Keychain {
|
|
|
104
104
|
* @example
|
|
105
105
|
*
|
|
106
106
|
* ```TypeScript
|
|
107
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
108
|
-
* const pemKey = await libp2p.keychain.exportKey('keyTest', 'password123')
|
|
109
|
-
* const keyInfo = await libp2p.keychain.importKey('keyTestImport', pemKey, 'password123')
|
|
107
|
+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
108
|
+
* const pemKey = await libp2p.services.keychain.exportKey('keyTest', 'password123')
|
|
109
|
+
* const keyInfo = await libp2p.services.keychain.importKey('keyTestImport', pemKey, 'password123')
|
|
110
110
|
* ```
|
|
111
111
|
*/
|
|
112
112
|
importKey(name: string, pem: string, password: string): Promise<KeyInfo>
|
|
@@ -117,7 +117,7 @@ export interface Keychain {
|
|
|
117
117
|
* @example
|
|
118
118
|
*
|
|
119
119
|
* ```TypeScript
|
|
120
|
-
* const keyInfo = await libp2p.keychain.importPeer('keyTestImport', peerIdFromString('12D3Foo...'))
|
|
120
|
+
* const keyInfo = await libp2p.services.keychain.importPeer('keyTestImport', peerIdFromString('12D3Foo...'))
|
|
121
121
|
* ```
|
|
122
122
|
*/
|
|
123
123
|
importPeer(name: string, peerId: PeerId): Promise<KeyInfo>
|
|
@@ -128,7 +128,7 @@ export interface Keychain {
|
|
|
128
128
|
* @example
|
|
129
129
|
*
|
|
130
130
|
* ```TypeScript
|
|
131
|
-
* const peerId = await libp2p.keychain.exportPeerId('key-name')
|
|
131
|
+
* const peerId = await libp2p.services.keychain.exportPeerId('key-name')
|
|
132
132
|
* ```
|
|
133
133
|
*/
|
|
134
134
|
exportPeerId(name: string): Promise<PeerId>
|
|
@@ -139,7 +139,7 @@ export interface Keychain {
|
|
|
139
139
|
* @example
|
|
140
140
|
*
|
|
141
141
|
* ```TypeScript
|
|
142
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
142
|
+
* const keyInfo = await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
143
143
|
* ```
|
|
144
144
|
*/
|
|
145
145
|
createKey(name: string, type: KeyType, size?: number): Promise<KeyInfo>
|
|
@@ -150,7 +150,7 @@ export interface Keychain {
|
|
|
150
150
|
* @example
|
|
151
151
|
*
|
|
152
152
|
* ```TypeScript
|
|
153
|
-
* const keyInfos = await libp2p.keychain.listKeys()
|
|
153
|
+
* const keyInfos = await libp2p.services.keychain.listKeys()
|
|
154
154
|
* ```
|
|
155
155
|
*/
|
|
156
156
|
listKeys(): Promise<KeyInfo[]>
|
|
@@ -161,8 +161,8 @@ export interface Keychain {
|
|
|
161
161
|
* @example
|
|
162
162
|
*
|
|
163
163
|
* ```TypeScript
|
|
164
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
165
|
-
* const keyInfo = await libp2p.keychain.removeKey('keyTest')
|
|
164
|
+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
165
|
+
* const keyInfo = await libp2p.services.keychain.removeKey('keyTest')
|
|
166
166
|
* ```
|
|
167
167
|
*/
|
|
168
168
|
removeKey(name: string): Promise<KeyInfo>
|
|
@@ -173,8 +173,8 @@ export interface Keychain {
|
|
|
173
173
|
* @example
|
|
174
174
|
*
|
|
175
175
|
* ```TypeScript
|
|
176
|
-
* await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
177
|
-
* const keyInfo = await libp2p.keychain.renameKey('keyTest', 'keyNewNtest')
|
|
176
|
+
* await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
177
|
+
* const keyInfo = await libp2p.services.keychain.renameKey('keyTest', 'keyNewNtest')
|
|
178
178
|
* ```
|
|
179
179
|
*/
|
|
180
180
|
renameKey(oldName: string, newName: string): Promise<KeyInfo>
|
|
@@ -185,8 +185,8 @@ export interface Keychain {
|
|
|
185
185
|
* @example
|
|
186
186
|
*
|
|
187
187
|
* ```TypeScript
|
|
188
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
189
|
-
* const keyInfo2 = await libp2p.keychain.findKeyById(keyInfo.id)
|
|
188
|
+
* const keyInfo = await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
189
|
+
* const keyInfo2 = await libp2p.services.keychain.findKeyById(keyInfo.id)
|
|
190
190
|
* ```
|
|
191
191
|
*/
|
|
192
192
|
findKeyById(id: string): Promise<KeyInfo>
|
|
@@ -197,8 +197,8 @@ export interface Keychain {
|
|
|
197
197
|
* @example
|
|
198
198
|
*
|
|
199
199
|
* ```TypeScript
|
|
200
|
-
* const keyInfo = await libp2p.keychain.createKey('keyTest', 'RSA', 4096)
|
|
201
|
-
* const keyInfo2 = await libp2p.keychain.findKeyByName('keyTest')
|
|
200
|
+
* const keyInfo = await libp2p.services.keychain.createKey('keyTest', 'RSA', 4096)
|
|
201
|
+
* const keyInfo2 = await libp2p.services.keychain.findKeyByName('keyTest')
|
|
202
202
|
* ```
|
|
203
203
|
*/
|
|
204
204
|
findKeyByName(name: string): Promise<KeyInfo>
|
|
@@ -209,7 +209,7 @@ export interface Keychain {
|
|
|
209
209
|
* @example
|
|
210
210
|
*
|
|
211
211
|
* ```TypeScript
|
|
212
|
-
* await libp2p.keychain.rotateKeychainPass('oldPassword', 'newPassword')
|
|
212
|
+
* await libp2p.services.keychain.rotateKeychainPass('oldPassword', 'newPassword')
|
|
213
213
|
* ```
|
|
214
214
|
*/
|
|
215
215
|
rotateKeychainPass(oldPass: string, newPass: string): Promise<void>
|