@substrate-system/keys 0.2.3 → 0.2.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/README.md +279 -160
- package/dist/_base.d.ts +183 -0
- package/dist/_base.d.ts.map +1 -0
- package/dist/aes/index.cjs +123 -0
- package/dist/aes/index.cjs.map +7 -0
- package/dist/aes/index.d.ts +20 -0
- package/dist/aes/index.d.ts.map +1 -0
- package/dist/aes/index.js +119 -0
- package/dist/aes/index.js.map +7 -0
- package/dist/aes/index.min.cjs +2 -0
- package/dist/aes/index.min.cjs.map +7 -0
- package/dist/aes/index.min.js +4 -0
- package/dist/aes/index.min.js.map +7 -0
- package/dist/constants.d.ts +15 -4
- package/dist/constants.d.ts.map +1 -1
- package/dist/ecc/index.cjs +412 -0
- package/dist/ecc/index.cjs.map +7 -0
- package/dist/ecc/index.d.ts +111 -0
- package/dist/ecc/index.d.ts.map +1 -0
- package/dist/ecc/index.js +414 -0
- package/dist/ecc/index.js.map +7 -0
- package/dist/ecc/index.min.cjs +2 -0
- package/dist/ecc/index.min.cjs.map +7 -0
- package/dist/ecc/index.min.js +4 -0
- package/dist/ecc/index.min.js.map +7 -0
- package/dist/errors.d.ts +27 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.ts +3 -190
- package/dist/index.d.ts.map +1 -1
- package/dist/meta.json +91 -118
- package/dist/rsa/index.cjs +283 -0
- package/dist/rsa/index.cjs.map +7 -0
- package/dist/rsa/index.d.ts +118 -0
- package/dist/rsa/index.d.ts.map +1 -0
- package/dist/rsa/index.js +287 -0
- package/dist/rsa/index.js.map +7 -0
- package/dist/rsa/index.min.cjs +2 -0
- package/dist/rsa/index.min.cjs.map +7 -0
- package/dist/rsa/index.min.js +4 -0
- package/dist/rsa/index.min.js.map +7 -0
- package/dist/types.d.ts +20 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/util.d.ts +15 -14
- package/dist/util.d.ts.map +1 -1
- package/package.json +38 -12
- package/dist/constants.cjs +0 -64
- package/dist/constants.cjs.map +0 -7
- package/dist/constants.js +0 -44
- package/dist/constants.js.map +0 -7
- package/dist/constants.min.cjs +0 -2
- package/dist/constants.min.cjs.map +0 -7
- package/dist/constants.min.js +0 -2
- package/dist/constants.min.js.map +0 -7
- package/dist/index.cjs +0 -480
- package/dist/index.cjs.map +0 -7
- package/dist/index.js +0 -493
- package/dist/index.js.map +0 -7
- package/dist/index.min.cjs +0 -2
- package/dist/index.min.cjs.map +0 -7
- package/dist/index.min.js +0 -4
- package/dist/index.min.js.map +0 -7
- package/dist/types.cjs +0 -57
- package/dist/types.cjs.map +0 -7
- package/dist/types.js +0 -37
- package/dist/types.js.map +0 -7
- package/dist/types.min.cjs +0 -2
- package/dist/types.min.cjs.map +0 -7
- package/dist/types.min.js +0 -2
- package/dist/types.min.js.map +0 -7
- package/dist/util.cjs +0 -375
- package/dist/util.cjs.map +0 -7
- package/dist/util.js +0 -373
- package/dist/util.js.map +0 -7
- package/dist/util.min.cjs +0 -4
- package/dist/util.min.cjs.map +0 -7
- package/dist/util.min.js +0 -4
- package/dist/util.min.js.map +0 -7
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { KeyUse, CryptoSystem } from './types.js';
|
|
2
|
+
export declare const KeyDoesNotExist: Error;
|
|
3
|
+
export declare const NotKeyPair: Error;
|
|
4
|
+
export declare const NotKey: Error;
|
|
5
|
+
export declare const ECCNotEnabled: Error;
|
|
6
|
+
export declare const UnsupportedCrypto: Error;
|
|
7
|
+
export declare const InvalidKeyUse: Error;
|
|
8
|
+
export declare const InvalidMaxValue: Error;
|
|
9
|
+
export declare function checkIsKeyPair(keypair: any): CryptoKeyPair;
|
|
10
|
+
export declare function checkIsKey(key: any): CryptoKey;
|
|
11
|
+
export declare function checkValidCryptoSystem(type: CryptoSystem): void;
|
|
12
|
+
export declare function checkValidKeyUse(use: KeyUse): void;
|
|
13
|
+
declare const _default: {
|
|
14
|
+
KeyDoesNotExist: Error;
|
|
15
|
+
NotKeyPair: Error;
|
|
16
|
+
NotKey: Error;
|
|
17
|
+
ECCNotEnabled: Error;
|
|
18
|
+
UnsupportedCrypto: Error;
|
|
19
|
+
InvalidKeyUse: Error;
|
|
20
|
+
checkIsKeyPair: typeof checkIsKeyPair;
|
|
21
|
+
checkIsKey: typeof checkIsKey;
|
|
22
|
+
checkValidCryptoSystem: typeof checkValidCryptoSystem;
|
|
23
|
+
checkValidKeyUse: typeof checkValidKeyUse;
|
|
24
|
+
InvalidMaxValue: Error;
|
|
25
|
+
};
|
|
26
|
+
export default _default;
|
|
27
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,YAAY,CAAA;AAEjD,eAAO,MAAM,eAAe,OACc,CAAA;AAC1C,eAAO,MAAM,UAAU,OACiD,CAAA;AACxE,eAAO,MAAM,MAAM,OACgD,CAAA;AACnE,eAAO,MAAM,aAAa,OACK,CAAA;AAC/B,eAAO,MAAM,iBAAiB,OACF,CAAA;AAC5B,eAAO,MAAM,aAAa,OACE,CAAA;AAC5B,eAAO,MAAM,eAAe,OACN,CAAA;AAEtB,wBAAgB,cAAc,CAAE,OAAO,EAAE,GAAG,GAAG,aAAa,CAO3D;AAED,wBAAgB,UAAU,CAAE,GAAG,EAAE,GAAG,GAAG,SAAS,CAO/C;AAED,wBAAgB,sBAAsB,CAAE,IAAI,EAAC,YAAY,GAAG,IAAI,CAE/D;AAED,wBAAgB,gBAAgB,CAAE,GAAG,EAAC,MAAM,GAAG,IAAI,CAElD;;;;;;;;;;;;;;AASD,wBAYC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,191 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { publicKeyToDid, getPublicKeyAsArrayBuffer };
|
|
5
|
-
export * from './constants.js';
|
|
6
|
-
export type { DID };
|
|
7
|
-
export { getPublicKeyAsUint8Array } from './util.js';
|
|
8
|
-
export type SerializedKeys = {
|
|
9
|
-
DID: DID;
|
|
10
|
-
publicEncryptKey: string;
|
|
11
|
-
};
|
|
12
|
-
/**
|
|
13
|
-
* Expose RSA keys only for now, because we are
|
|
14
|
-
* waiting for more browsers to support ECC.
|
|
15
|
-
*
|
|
16
|
-
* Create an instance with `Keys.create` b/c async.
|
|
17
|
-
*/
|
|
18
|
-
export declare class Keys {
|
|
19
|
-
private _encryptKey;
|
|
20
|
-
private _signKey;
|
|
21
|
-
static _instance: any;
|
|
22
|
-
persisted: boolean;
|
|
23
|
-
ENCRYPTION_KEY_NAME: string;
|
|
24
|
-
SIGNING_KEY_NAME: string;
|
|
25
|
-
DID: DID;
|
|
26
|
-
session: boolean;
|
|
27
|
-
constructor(opts: {
|
|
28
|
-
keys: {
|
|
29
|
-
encrypt: CryptoKeyPair;
|
|
30
|
-
sign: CryptoKeyPair;
|
|
31
|
-
};
|
|
32
|
-
did: DID;
|
|
33
|
-
persisted: boolean;
|
|
34
|
-
session: boolean;
|
|
35
|
-
});
|
|
36
|
-
get signKeypair(): CryptoKeyPair;
|
|
37
|
-
get encryptKeypair(): CryptoKeyPair;
|
|
38
|
-
get publicSignKey(): CryptoKey;
|
|
39
|
-
get privateSignKey(): CryptoKey;
|
|
40
|
-
get privateEncryptKey(): CryptoKey;
|
|
41
|
-
get publicEncryptKey(): CryptoKey;
|
|
42
|
-
get deviceName(): Promise<string>;
|
|
43
|
-
/**
|
|
44
|
-
* Delete the keys stored in indexedDB.
|
|
45
|
-
*/
|
|
46
|
-
delete(): Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Get the public encryption key as a string.
|
|
49
|
-
*
|
|
50
|
-
* @param {SupportedEncodings} [format] Optional string format for
|
|
51
|
-
* `uint8arrays`. Defaults to base64.
|
|
52
|
-
* @returns {string} Return a string b/c mostly would use this for
|
|
53
|
-
* serializing the public encryption key.
|
|
54
|
-
*/
|
|
55
|
-
getPublicEncryptKey: ((format?: SupportedEncodings) => Promise<string>) & {
|
|
56
|
-
uint8Array: () => Promise<Uint8Array>;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* Return a 32-character, DNS-friendly hash of the given DID.
|
|
60
|
-
*
|
|
61
|
-
* @param {DID} did a DID format string
|
|
62
|
-
* @returns {string} 32 character, base32 hash of the DID
|
|
63
|
-
*/
|
|
64
|
-
static deviceName(did: DID): Promise<string>;
|
|
65
|
-
/**
|
|
66
|
-
* Create a new `Keys` instance.
|
|
67
|
-
*
|
|
68
|
-
* @returns {Promise<Keys>}
|
|
69
|
-
*/
|
|
70
|
-
static create(opts?: {
|
|
71
|
-
session: boolean;
|
|
72
|
-
}): Promise<Keys>;
|
|
73
|
-
/**
|
|
74
|
-
* Save this keys instance to `indexedDB`.
|
|
75
|
-
*/
|
|
76
|
-
persist(): Promise<void>;
|
|
77
|
-
/**
|
|
78
|
-
* Return a 32-character, DNS friendly hash of the public signing key.
|
|
79
|
-
*
|
|
80
|
-
* @returns {Promise<string>}
|
|
81
|
-
*/
|
|
82
|
-
getDeviceName(): Promise<string>;
|
|
83
|
-
/**
|
|
84
|
-
* Restore some keys from indexedDB, or create a new keypair if it doesn't
|
|
85
|
-
* exist yet.
|
|
86
|
-
*
|
|
87
|
-
* @param {{ encryptionKeyName, signingKeyName }} opts Strings to use as
|
|
88
|
-
* keys in indexedDB.
|
|
89
|
-
* @returns {Promise<Keys>}
|
|
90
|
-
*/
|
|
91
|
-
static load(opts?: Partial<{
|
|
92
|
-
encryptionKeyName: string;
|
|
93
|
-
signingKeyName: string;
|
|
94
|
-
session: boolean;
|
|
95
|
-
}>): Promise<InstanceType<typeof Keys>>;
|
|
96
|
-
decrypt: ((msg: string | Uint8Array | ArrayBuffer, keysize?: SymmKeyLength) => Promise<Uint8Array>) & {
|
|
97
|
-
asString: (msg: string, keysize?: SymmKeyLength) => Promise<string>;
|
|
98
|
-
};
|
|
99
|
-
sign: ((msg: Msg, charsize?: CharSize) => Promise<Uint8Array>) & {
|
|
100
|
-
/**
|
|
101
|
-
* Sign a message, return the signature as a base64 encoded string.
|
|
102
|
-
*
|
|
103
|
-
* @param {Msg} msg The message to sign
|
|
104
|
-
* @param {CharSize} [charsize] Character size
|
|
105
|
-
* @returns {Promise<string>}
|
|
106
|
-
*/
|
|
107
|
-
asString: (msg: Msg, charsize?: CharSize) => Promise<string>;
|
|
108
|
-
};
|
|
109
|
-
/**
|
|
110
|
-
* Decrypt the given encrypted AES key.
|
|
111
|
-
* Return the key as `Uint8Array`.
|
|
112
|
-
*/
|
|
113
|
-
decryptKey: ((key: string | Uint8Array | ArrayBuffer) => Promise<Uint8Array>) & {
|
|
114
|
-
/**
|
|
115
|
-
* Decrypt the given AES key, return the result as a string.
|
|
116
|
-
*/
|
|
117
|
-
asString: (msg: string | Uint8Array, format?: SupportedEncodings) => Promise<string>;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* Serialize this keys instance. Will return an object of
|
|
121
|
-
* { DID, publicEncryptionKey }, where DID is the public signature key,
|
|
122
|
-
* and `publicEncryptKey` is the encryption key, `base64` encoded.
|
|
123
|
-
* @returns {Promise<{ DID:DID, publicEncryptKey:string }>}
|
|
124
|
-
*/
|
|
125
|
-
toJson(): Promise<{
|
|
126
|
-
DID: DID;
|
|
127
|
-
publicEncryptKey: string;
|
|
128
|
-
}>;
|
|
129
|
-
}
|
|
130
|
-
/**
|
|
131
|
-
* Check that the given signature is valid with the given message.
|
|
132
|
-
*/
|
|
133
|
-
export declare function verify(msg: string | Uint8Array, sig: string | Uint8Array, signingDid: DID): Promise<boolean>;
|
|
134
|
-
/**
|
|
135
|
-
* Encrypt the given message to the given public key. If an AES key is not
|
|
136
|
-
* provided, one will be created. Use an AES key to encrypt the given
|
|
137
|
-
* content, then we encrypt the AES key to the given public key.
|
|
138
|
-
*
|
|
139
|
-
* @param {{ content, publicKey }} opts The content to encrypt and
|
|
140
|
-
* public key to encrypt to
|
|
141
|
-
* @param {SymmKey|Uint8Array|string} [aesKey] An optional AES key to encrypt
|
|
142
|
-
* to the given public key
|
|
143
|
-
* @returns {Promise<ArrayBuffer>} The encrypted AES key, concattenated with
|
|
144
|
-
* the encrypted content.
|
|
145
|
-
*/
|
|
146
|
-
export declare function encryptTo(opts: {
|
|
147
|
-
content: string | Uint8Array;
|
|
148
|
-
publicKey: CryptoKey | string;
|
|
149
|
-
}, aesKey?: SymmKey | Uint8Array | string): Promise<ArrayBuffer>;
|
|
150
|
-
export declare namespace encryptTo {
|
|
151
|
-
var asString: (opts: {
|
|
152
|
-
content: string | Uint8Array;
|
|
153
|
-
publicKey: CryptoKey | string;
|
|
154
|
-
}, aesKey?: SymmKey | Uint8Array | string) => Promise<string>;
|
|
155
|
-
}
|
|
156
|
-
export declare const AES: {
|
|
157
|
-
create(opts?: {
|
|
158
|
-
alg: string;
|
|
159
|
-
length: number;
|
|
160
|
-
}): Promise<CryptoKey>;
|
|
161
|
-
export: ((key: CryptoKey) => Promise<Uint8Array>) & {
|
|
162
|
-
asString: (key: CryptoKey, format?: SupportedEncodings) => Promise<string>;
|
|
163
|
-
};
|
|
164
|
-
import(key: Uint8Array | string): Promise<CryptoKey>;
|
|
165
|
-
exportAsString(key: CryptoKey): Promise<string>;
|
|
166
|
-
encrypt: typeof encrypt;
|
|
167
|
-
decrypt(encryptedData: Uint8Array | string | ArrayBuffer, cryptoKey: CryptoKey | Uint8Array | ArrayBuffer, iv?: Uint8Array): Promise<Uint8Array>;
|
|
168
|
-
};
|
|
169
|
-
export declare function encryptKeyTo({ key, publicKey }: {
|
|
170
|
-
key: string | Uint8Array | CryptoKey;
|
|
171
|
-
publicKey: CryptoKey | Uint8Array | string;
|
|
172
|
-
}, format: 'arraybuffer'): Promise<ArrayBuffer>;
|
|
173
|
-
export declare function encryptKeyTo({ key, publicKey }: {
|
|
174
|
-
key: string | Uint8Array | CryptoKey;
|
|
175
|
-
publicKey: CryptoKey | Uint8Array | string;
|
|
176
|
-
}, format: 'uint8array'): Promise<Uint8Array>;
|
|
177
|
-
export declare function encryptKeyTo({ key, publicKey }: {
|
|
178
|
-
key: string | Uint8Array | CryptoKey;
|
|
179
|
-
publicKey: CryptoKey | Uint8Array | string;
|
|
180
|
-
}, format?: undefined): Promise<Uint8Array>;
|
|
181
|
-
export declare namespace encryptKeyTo {
|
|
182
|
-
var asString: ({ key, publicKey }: {
|
|
183
|
-
key: string | Uint8Array | CryptoKey;
|
|
184
|
-
publicKey: CryptoKey | string | Uint8Array;
|
|
185
|
-
}, format?: SupportedEncodings) => Promise<string>;
|
|
186
|
-
}
|
|
187
|
-
declare function encrypt(data: Uint8Array, cryptoKey: CryptoKey | Uint8Array, format?: undefined, iv?: Uint8Array): Promise<Uint8Array>;
|
|
188
|
-
declare function encrypt(data: Uint8Array, cryptoKey: CryptoKey | Uint8Array, format: 'uint8array', iv?: Uint8Array): Promise<Uint8Array>;
|
|
189
|
-
declare function encrypt(data: Uint8Array, cryptoKey: CryptoKey | Uint8Array, format: 'arraybuffer', iv?: Uint8Array): Promise<ArrayBuffer>;
|
|
190
|
-
export declare function getDeviceName(did: DID | string): Promise<string>;
|
|
1
|
+
export * as rsa from './rsa/index.js';
|
|
2
|
+
export * as ecc from './ecc/index.js';
|
|
3
|
+
export * as aes from './aes/index.js';
|
|
191
4
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAA"}
|
package/dist/meta.json
CHANGED
|
@@ -1,76 +1,75 @@
|
|
|
1
1
|
{
|
|
2
2
|
"inputs": {
|
|
3
|
-
"src/
|
|
4
|
-
"bytes":
|
|
3
|
+
"src/aes/index.ts": {
|
|
4
|
+
"bytes": 5643,
|
|
5
5
|
"imports": [],
|
|
6
6
|
"format": "esm"
|
|
7
7
|
},
|
|
8
|
-
"src/index.ts": {
|
|
9
|
-
"bytes":
|
|
8
|
+
"src/ecc/index.ts": {
|
|
9
|
+
"bytes": 17330,
|
|
10
10
|
"imports": [],
|
|
11
11
|
"format": "esm"
|
|
12
12
|
},
|
|
13
|
-
"src/
|
|
14
|
-
"bytes":
|
|
15
|
-
"imports": [],
|
|
16
|
-
"format": "esm"
|
|
17
|
-
},
|
|
18
|
-
"src/util.ts": {
|
|
19
|
-
"bytes": 13698,
|
|
13
|
+
"src/rsa/index.ts": {
|
|
14
|
+
"bytes": 15005,
|
|
20
15
|
"imports": [],
|
|
21
16
|
"format": "esm"
|
|
22
17
|
}
|
|
23
18
|
},
|
|
24
19
|
"outputs": {
|
|
25
|
-
"dist/
|
|
20
|
+
"dist/aes/index.js.map": {
|
|
26
21
|
"imports": [],
|
|
27
22
|
"exports": [],
|
|
28
23
|
"inputs": {},
|
|
29
|
-
"bytes":
|
|
24
|
+
"bytes": 8401
|
|
30
25
|
},
|
|
31
|
-
"dist/
|
|
26
|
+
"dist/aes/index.js": {
|
|
32
27
|
"imports": [
|
|
33
28
|
{
|
|
34
|
-
"path": "
|
|
29
|
+
"path": "@substrate-system/one-webcrypto",
|
|
30
|
+
"kind": "import-statement",
|
|
31
|
+
"external": true
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"path": "uint8arrays",
|
|
35
|
+
"kind": "import-statement",
|
|
36
|
+
"external": true
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "../util.js",
|
|
40
|
+
"kind": "import-statement",
|
|
41
|
+
"external": true
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"path": "../types.js",
|
|
45
|
+
"kind": "import-statement",
|
|
46
|
+
"external": true
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"path": "../constants.js",
|
|
35
50
|
"kind": "import-statement",
|
|
36
51
|
"external": true
|
|
37
52
|
}
|
|
38
53
|
],
|
|
39
54
|
"exports": [
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"BLS_DID_PREFIX",
|
|
43
|
-
"DEFAULT_CHAR_SIZE",
|
|
44
|
-
"DEFAULT_ENC_NAME",
|
|
45
|
-
"DEFAULT_HASH_ALGORITHM",
|
|
46
|
-
"DEFAULT_RSA_SIZE",
|
|
47
|
-
"DEFAULT_SIG_NAME",
|
|
48
|
-
"DEFAULT_SYMM_ALGORITHM",
|
|
49
|
-
"DEFAULT_SYMM_LENGTH",
|
|
50
|
-
"EDWARDS_DID_PREFIX",
|
|
51
|
-
"IV_LENGTH",
|
|
52
|
-
"KEY_TYPE",
|
|
53
|
-
"RSA_ALGORITHM",
|
|
54
|
-
"RSA_DID_PREFIX",
|
|
55
|
-
"RSA_HASHING_ALGORITHM",
|
|
56
|
-
"RSA_SIGN_ALGORITHM",
|
|
57
|
-
"SALT_LENGTH"
|
|
55
|
+
"AES",
|
|
56
|
+
"importAesKey"
|
|
58
57
|
],
|
|
59
|
-
"entryPoint": "src/
|
|
58
|
+
"entryPoint": "src/aes/index.ts",
|
|
60
59
|
"inputs": {
|
|
61
|
-
"src/
|
|
62
|
-
"bytesInOutput":
|
|
60
|
+
"src/aes/index.ts": {
|
|
61
|
+
"bytesInOutput": 3594
|
|
63
62
|
}
|
|
64
63
|
},
|
|
65
|
-
"bytes":
|
|
64
|
+
"bytes": 3791
|
|
66
65
|
},
|
|
67
|
-
"dist/index.js.map": {
|
|
66
|
+
"dist/ecc/index.js.map": {
|
|
68
67
|
"imports": [],
|
|
69
68
|
"exports": [],
|
|
70
69
|
"inputs": {},
|
|
71
|
-
"bytes":
|
|
70
|
+
"bytes": 25214
|
|
72
71
|
},
|
|
73
|
-
"dist/index.js": {
|
|
72
|
+
"dist/ecc/index.js": {
|
|
74
73
|
"imports": [
|
|
75
74
|
{
|
|
76
75
|
"path": "@substrate-system/one-webcrypto",
|
|
@@ -83,85 +82,53 @@
|
|
|
83
82
|
"external": true
|
|
84
83
|
},
|
|
85
84
|
{
|
|
86
|
-
"path": "
|
|
87
|
-
"kind": "import-statement",
|
|
88
|
-
"external": true
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
"path": "./constants.js",
|
|
85
|
+
"path": "../constants.js",
|
|
92
86
|
"kind": "import-statement",
|
|
93
87
|
"external": true
|
|
94
88
|
},
|
|
95
89
|
{
|
|
96
|
-
"path": "
|
|
90
|
+
"path": "../types.js",
|
|
97
91
|
"kind": "import-statement",
|
|
98
92
|
"external": true
|
|
99
93
|
},
|
|
100
94
|
{
|
|
101
|
-
"path": "
|
|
95
|
+
"path": "../util.js",
|
|
102
96
|
"kind": "import-statement",
|
|
103
97
|
"external": true
|
|
104
98
|
},
|
|
105
99
|
{
|
|
106
|
-
"path": "
|
|
100
|
+
"path": "../errors.js",
|
|
107
101
|
"kind": "import-statement",
|
|
108
102
|
"external": true
|
|
109
103
|
},
|
|
110
104
|
{
|
|
111
|
-
"path": "
|
|
105
|
+
"path": "../_base.js",
|
|
112
106
|
"kind": "import-statement",
|
|
113
107
|
"external": true
|
|
114
108
|
}
|
|
115
109
|
],
|
|
116
110
|
"exports": [
|
|
117
|
-
"
|
|
118
|
-
"
|
|
119
|
-
"
|
|
120
|
-
"
|
|
121
|
-
"getDeviceName",
|
|
122
|
-
"getPublicKeyAsArrayBuffer",
|
|
123
|
-
"getPublicKeyAsUint8Array",
|
|
124
|
-
"publicKeyToDid",
|
|
111
|
+
"EccKeys",
|
|
112
|
+
"default",
|
|
113
|
+
"exportPublicKey",
|
|
114
|
+
"importPublicKey",
|
|
125
115
|
"verify"
|
|
126
116
|
],
|
|
127
|
-
"entryPoint": "src/index.ts",
|
|
128
|
-
"inputs": {
|
|
129
|
-
"src/index.ts": {
|
|
130
|
-
"bytesInOutput": 14291
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
"bytes": 14913
|
|
134
|
-
},
|
|
135
|
-
"dist/types.js.map": {
|
|
136
|
-
"imports": [],
|
|
137
|
-
"exports": [],
|
|
138
|
-
"inputs": {},
|
|
139
|
-
"bytes": 1604
|
|
140
|
-
},
|
|
141
|
-
"dist/types.js": {
|
|
142
|
-
"imports": [],
|
|
143
|
-
"exports": [
|
|
144
|
-
"CharSize",
|
|
145
|
-
"HashAlg",
|
|
146
|
-
"KeyUse",
|
|
147
|
-
"RsaSize",
|
|
148
|
-
"SymmKeyLength"
|
|
149
|
-
],
|
|
150
|
-
"entryPoint": "src/types.ts",
|
|
117
|
+
"entryPoint": "src/ecc/index.ts",
|
|
151
118
|
"inputs": {
|
|
152
|
-
"src/
|
|
153
|
-
"bytesInOutput":
|
|
119
|
+
"src/ecc/index.ts": {
|
|
120
|
+
"bytesInOutput": 12416
|
|
154
121
|
}
|
|
155
122
|
},
|
|
156
|
-
"bytes":
|
|
123
|
+
"bytes": 12948
|
|
157
124
|
},
|
|
158
|
-
"dist/
|
|
125
|
+
"dist/rsa/index.js.map": {
|
|
159
126
|
"imports": [],
|
|
160
127
|
"exports": [],
|
|
161
128
|
"inputs": {},
|
|
162
|
-
"bytes":
|
|
129
|
+
"bytes": 21065
|
|
163
130
|
},
|
|
164
|
-
"dist/
|
|
131
|
+
"dist/rsa/index.js": {
|
|
165
132
|
"imports": [
|
|
166
133
|
{
|
|
167
134
|
"path": "@substrate-system/one-webcrypto",
|
|
@@ -174,52 +141,58 @@
|
|
|
174
141
|
"external": true
|
|
175
142
|
},
|
|
176
143
|
{
|
|
177
|
-
"path": "
|
|
144
|
+
"path": "../aes/index.js",
|
|
145
|
+
"kind": "import-statement",
|
|
146
|
+
"external": true
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
"path": "../constants.js",
|
|
150
|
+
"kind": "import-statement",
|
|
151
|
+
"external": true
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"path": "../_base.js",
|
|
155
|
+
"kind": "import-statement",
|
|
156
|
+
"external": true
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"path": "../types.js",
|
|
160
|
+
"kind": "import-statement",
|
|
161
|
+
"external": true
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"path": "../util.js",
|
|
178
165
|
"kind": "import-statement",
|
|
179
166
|
"external": true
|
|
180
167
|
},
|
|
181
168
|
{
|
|
182
|
-
"path": "
|
|
169
|
+
"path": "../constants.js",
|
|
170
|
+
"kind": "import-statement",
|
|
171
|
+
"external": true
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
"path": "../util.js",
|
|
183
175
|
"kind": "import-statement",
|
|
184
176
|
"external": true
|
|
185
177
|
}
|
|
186
178
|
],
|
|
187
179
|
"exports": [
|
|
188
|
-
"
|
|
189
|
-
"
|
|
190
|
-
"
|
|
191
|
-
"
|
|
192
|
-
"createDeviceName",
|
|
193
|
-
"did",
|
|
194
|
-
"didToPublicKey",
|
|
195
|
-
"fromBase64",
|
|
180
|
+
"RsaKeys",
|
|
181
|
+
"encrypt",
|
|
182
|
+
"encryptKeyTo",
|
|
183
|
+
"encryptTo",
|
|
196
184
|
"getPublicKeyAsArrayBuffer",
|
|
197
185
|
"getPublicKeyAsUint8Array",
|
|
198
|
-
"importKey",
|
|
199
|
-
"importPublicKey",
|
|
200
|
-
"importRsaKey",
|
|
201
|
-
"isCryptoKey",
|
|
202
|
-
"joinBufs",
|
|
203
|
-
"normalizeBase64ToBuf",
|
|
204
|
-
"normalizeToBuf",
|
|
205
|
-
"normalizeUnicodeToBuf",
|
|
206
|
-
"normalizeUtf16ToBuf",
|
|
207
|
-
"normalizeUtf8ToBuf",
|
|
208
186
|
"publicKeyToDid",
|
|
209
|
-
"
|
|
210
|
-
"rsaOperations",
|
|
211
|
-
"rsaVerify",
|
|
212
|
-
"sha256",
|
|
213
|
-
"strToArrBuf",
|
|
214
|
-
"toBase64"
|
|
187
|
+
"verify"
|
|
215
188
|
],
|
|
216
|
-
"entryPoint": "src/
|
|
189
|
+
"entryPoint": "src/rsa/index.ts",
|
|
217
190
|
"inputs": {
|
|
218
|
-
"src/
|
|
219
|
-
"bytesInOutput":
|
|
191
|
+
"src/rsa/index.ts": {
|
|
192
|
+
"bytesInOutput": 9045
|
|
220
193
|
}
|
|
221
194
|
},
|
|
222
|
-
"bytes":
|
|
195
|
+
"bytes": 9628
|
|
223
196
|
}
|
|
224
197
|
}
|
|
225
198
|
}
|