@libp2p/keychain 6.0.12 → 6.0.14
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/index.min.js +3 -6
- package/dist/index.min.js.map +4 -4
- package/dist/src/index.js +1 -1
- package/dist/src/keychain.d.ts +1 -1
- package/dist/src/keychain.js +2 -2
- package/dist/src/utils/export.js +1 -1
- package/dist/src/utils/import.js +1 -1
- package/package.json +6 -5
- package/src/index.ts +1 -1
- package/src/keychain.ts +3 -3
- package/src/utils/export.ts +1 -1
- package/src/utils/import.ts +1 -1
package/dist/src/index.js
CHANGED
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
*
|
|
49
49
|
* A key benefit is that now the key chain can be used in browser with the [js-datastore-level](https://github.com/ipfs/js-datastore-level) implementation.
|
|
50
50
|
*/
|
|
51
|
-
import { Keychain as KeychainClass } from
|
|
51
|
+
import { Keychain as KeychainClass } from "./keychain.js";
|
|
52
52
|
export function keychain(init = {}) {
|
|
53
53
|
return (components) => {
|
|
54
54
|
return new KeychainClass(components, init);
|
package/dist/src/keychain.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { serviceCapabilities } from '@libp2p/interface';
|
|
2
|
-
import type { KeychainComponents, KeychainInit, Keychain as KeychainInterface, KeyInfo } from './index.
|
|
2
|
+
import type { KeychainComponents, KeychainInit, Keychain as KeychainInterface, KeyInfo } from './index.ts';
|
|
3
3
|
import type { PrivateKey } from '@libp2p/interface';
|
|
4
4
|
export declare function keyId(key: PrivateKey): Promise<string>;
|
|
5
5
|
/**
|
package/dist/src/keychain.js
CHANGED
|
@@ -9,8 +9,8 @@ import sanitize from 'sanitize-filename';
|
|
|
9
9
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string';
|
|
10
10
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
|
|
11
11
|
import { DEK_INIT } from "./constants.js";
|
|
12
|
-
import { exportPrivateKey } from
|
|
13
|
-
import { importPrivateKey } from
|
|
12
|
+
import { exportPrivateKey } from "./utils/export.js";
|
|
13
|
+
import { importPrivateKey } from "./utils/import.js";
|
|
14
14
|
const keyPrefix = '/pkcs8/';
|
|
15
15
|
const infoPrefix = '/info/';
|
|
16
16
|
const privates = new WeakMap();
|
package/dist/src/utils/export.js
CHANGED
|
@@ -8,7 +8,7 @@ import { sha512 } from '@noble/hashes/sha2.js';
|
|
|
8
8
|
import * as asn1js from 'asn1js';
|
|
9
9
|
import { base64 } from 'multiformats/bases/base64';
|
|
10
10
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string';
|
|
11
|
-
import { ITERATIONS, KEY_SIZE, SALT_LENGTH } from
|
|
11
|
+
import { ITERATIONS, KEY_SIZE, SALT_LENGTH } from "./constants.js";
|
|
12
12
|
/**
|
|
13
13
|
* Exports the given PrivateKey as a base64 encoded string.
|
|
14
14
|
* The PrivateKey is encrypted via a password derived PBKDF2 key
|
package/dist/src/utils/import.js
CHANGED
|
@@ -7,7 +7,7 @@ import { sha512 } from '@noble/hashes/sha2.js';
|
|
|
7
7
|
import * as asn1js from 'asn1js';
|
|
8
8
|
import { base64 } from 'multiformats/bases/base64';
|
|
9
9
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string';
|
|
10
|
-
import { ITERATIONS, KEY_SIZE } from
|
|
10
|
+
import { ITERATIONS, KEY_SIZE } from "./constants.js";
|
|
11
11
|
/**
|
|
12
12
|
* Converts an exported private key into its representative object.
|
|
13
13
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@libp2p/keychain",
|
|
3
|
-
"version": "6.0.
|
|
3
|
+
"version": "6.0.14",
|
|
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",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"exports": {
|
|
35
35
|
".": {
|
|
36
36
|
"types": "./dist/src/index.d.ts",
|
|
37
|
-
"import": "./dist/src/index.js"
|
|
37
|
+
"import": "./dist/src/index.js",
|
|
38
|
+
"module-sync": "./dist/src/index.js"
|
|
38
39
|
}
|
|
39
40
|
},
|
|
40
41
|
"scripts": {
|
|
@@ -52,8 +53,8 @@
|
|
|
52
53
|
"test:electron-main": "aegir test -t electron-main"
|
|
53
54
|
},
|
|
54
55
|
"dependencies": {
|
|
55
|
-
"@libp2p/crypto": "^5.1.
|
|
56
|
-
"@libp2p/interface": "^3.2.
|
|
56
|
+
"@libp2p/crypto": "^5.1.17",
|
|
57
|
+
"@libp2p/interface": "^3.2.2",
|
|
57
58
|
"@noble/hashes": "^2.0.1",
|
|
58
59
|
"asn1js": "^3.0.6",
|
|
59
60
|
"interface-datastore": "^9.0.1",
|
|
@@ -62,7 +63,7 @@
|
|
|
62
63
|
"uint8arrays": "^5.1.0"
|
|
63
64
|
},
|
|
64
65
|
"devDependencies": {
|
|
65
|
-
"@libp2p/logger": "^6.2.
|
|
66
|
+
"@libp2p/logger": "^6.2.6",
|
|
66
67
|
"aegir": "^47.0.22",
|
|
67
68
|
"datastore-core": "^11.0.1"
|
|
68
69
|
},
|
package/src/index.ts
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
* A key benefit is that now the key chain can be used in browser with the [js-datastore-level](https://github.com/ipfs/js-datastore-level) implementation.
|
|
50
50
|
*/
|
|
51
51
|
|
|
52
|
-
import { Keychain as KeychainClass } from './keychain.
|
|
52
|
+
import { Keychain as KeychainClass } from './keychain.ts'
|
|
53
53
|
import type { ComponentLogger, PrivateKey } from '@libp2p/interface'
|
|
54
54
|
import type { Datastore } from 'interface-datastore'
|
|
55
55
|
|
package/src/keychain.ts
CHANGED
|
@@ -10,9 +10,9 @@ import sanitize from 'sanitize-filename'
|
|
|
10
10
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
11
11
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
|
12
12
|
import { DEK_INIT } from './constants.ts'
|
|
13
|
-
import { exportPrivateKey } from './utils/export.
|
|
14
|
-
import { importPrivateKey } from './utils/import.
|
|
15
|
-
import type { KeychainComponents, KeychainInit, Keychain as KeychainInterface, KeyInfo } from './index.
|
|
13
|
+
import { exportPrivateKey } from './utils/export.ts'
|
|
14
|
+
import { importPrivateKey } from './utils/import.ts'
|
|
15
|
+
import type { KeychainComponents, KeychainInit, Keychain as KeychainInterface, KeyInfo } from './index.ts'
|
|
16
16
|
import type { Logger, PrivateKey } from '@libp2p/interface'
|
|
17
17
|
|
|
18
18
|
const keyPrefix = '/pkcs8/'
|
package/src/utils/export.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { sha512 } from '@noble/hashes/sha2.js'
|
|
|
8
8
|
import * as asn1js from 'asn1js'
|
|
9
9
|
import { base64 } from 'multiformats/bases/base64'
|
|
10
10
|
import { toString as uint8ArrayToString } from 'uint8arrays/to-string'
|
|
11
|
-
import { ITERATIONS, KEY_SIZE, SALT_LENGTH } from './constants.
|
|
11
|
+
import { ITERATIONS, KEY_SIZE, SALT_LENGTH } from './constants.ts'
|
|
12
12
|
import type { ECDSAPrivateKey, Ed25519PrivateKey, PrivateKey, RSAPrivateKey, Secp256k1PrivateKey } from '@libp2p/interface'
|
|
13
13
|
import type { Multibase } from 'multiformats/bases/interface'
|
|
14
14
|
|
package/src/utils/import.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { sha512 } from '@noble/hashes/sha2.js'
|
|
|
7
7
|
import * as asn1js from 'asn1js'
|
|
8
8
|
import { base64 } from 'multiformats/bases/base64'
|
|
9
9
|
import { fromString as uint8ArrayFromString } from 'uint8arrays/from-string'
|
|
10
|
-
import { ITERATIONS, KEY_SIZE } from './constants.
|
|
10
|
+
import { ITERATIONS, KEY_SIZE } from './constants.ts'
|
|
11
11
|
import type { PrivateKey, RSAPrivateKey } from '@libp2p/interface'
|
|
12
12
|
|
|
13
13
|
/**
|