@nmshd/crypto 1.0.9 → 2.0.0
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/CoreBuffer.d.ts +0 -1
- package/dist/CoreBuffer.js +1 -4
- package/dist/CoreBuffer.js.map +1 -1
- package/dist/CryptoDerivation.js +2 -2
- package/dist/CryptoDerivation.js.map +1 -1
- package/dist/CryptoPrivateKey.d.ts +7 -10
- package/dist/CryptoPrivateKey.js +18 -33
- package/dist/CryptoPrivateKey.js.map +1 -1
- package/dist/CryptoPublicKey.d.ts +6 -9
- package/dist/CryptoPublicKey.js +16 -31
- package/dist/CryptoPublicKey.js.map +1 -1
- package/dist/CryptoSerializable.js.map +1 -1
- package/dist/CryptoValidation.d.ts +4 -6
- package/dist/CryptoValidation.js +16 -29
- package/dist/CryptoValidation.js.map +1 -1
- package/dist/buildInformation.js +4 -4
- package/dist/encryption/CryptoCipher.d.ts +5 -6
- package/dist/encryption/CryptoCipher.js +59 -56
- package/dist/encryption/CryptoCipher.js.map +1 -1
- package/dist/encryption/CryptoEncryption.js +10 -12
- package/dist/encryption/CryptoEncryption.js.map +1 -1
- package/dist/encryption/CryptoSecretKey.d.ts +3 -4
- package/dist/encryption/CryptoSecretKey.js +34 -30
- package/dist/encryption/CryptoSecretKey.js.map +1 -1
- package/dist/exchange/CryptoExchange.d.ts +0 -2
- package/dist/exchange/CryptoExchange.js +3 -20
- package/dist/exchange/CryptoExchange.js.map +1 -1
- package/dist/exchange/CryptoExchangeKeypair.d.ts +3 -4
- package/dist/exchange/CryptoExchangeKeypair.js +29 -22
- package/dist/exchange/CryptoExchangeKeypair.js.map +1 -1
- package/dist/exchange/CryptoExchangePrivateKey.d.ts +3 -5
- package/dist/exchange/CryptoExchangePrivateKey.js +50 -31
- package/dist/exchange/CryptoExchangePrivateKey.js.map +1 -1
- package/dist/exchange/CryptoExchangePublicKey.d.ts +3 -4
- package/dist/exchange/CryptoExchangePublicKey.js +28 -29
- package/dist/exchange/CryptoExchangePublicKey.js.map +1 -1
- package/dist/exchange/CryptoExchangeSecrets.d.ts +4 -5
- package/dist/exchange/CryptoExchangeSecrets.js +32 -34
- package/dist/exchange/CryptoExchangeSecrets.js.map +1 -1
- package/dist/exchange/CryptoExchangeValidation.d.ts +7 -10
- package/dist/exchange/CryptoExchangeValidation.js +9 -36
- package/dist/exchange/CryptoExchangeValidation.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/relationship/CryptoRelationshipPublicRequest.d.ts +1 -2
- package/dist/relationship/CryptoRelationshipPublicRequest.js +19 -34
- package/dist/relationship/CryptoRelationshipPublicRequest.js.map +1 -1
- package/dist/relationship/CryptoRelationshipPublicResponse.d.ts +1 -2
- package/dist/relationship/CryptoRelationshipPublicResponse.js +20 -30
- package/dist/relationship/CryptoRelationshipPublicResponse.js.map +1 -1
- package/dist/relationship/CryptoRelationshipRequestSecrets.d.ts +0 -1
- package/dist/relationship/CryptoRelationshipRequestSecrets.js +1 -4
- package/dist/relationship/CryptoRelationshipRequestSecrets.js.map +1 -1
- package/dist/relationship/CryptoRelationshipSecrets.d.ts +0 -1
- package/dist/relationship/CryptoRelationshipSecrets.js +1 -4
- package/dist/relationship/CryptoRelationshipSecrets.js.map +1 -1
- package/dist/signature/CryptoSignature.d.ts +5 -6
- package/dist/signature/CryptoSignature.js +36 -32
- package/dist/signature/CryptoSignature.js.map +1 -1
- package/dist/signature/CryptoSignatureAlgorithm.d.ts +5 -0
- package/dist/signature/CryptoSignatureAlgorithm.js +3 -0
- package/dist/signature/CryptoSignatureAlgorithm.js.map +1 -0
- package/dist/signature/CryptoSignatureKeypair.d.ts +3 -4
- package/dist/signature/CryptoSignatureKeypair.js +32 -30
- package/dist/signature/CryptoSignatureKeypair.js.map +1 -1
- package/dist/signature/CryptoSignaturePrivateKey.d.ts +5 -8
- package/dist/signature/CryptoSignaturePrivateKey.js +24 -35
- package/dist/signature/CryptoSignaturePrivateKey.js.map +1 -1
- package/dist/signature/CryptoSignaturePublicKey.d.ts +4 -7
- package/dist/signature/CryptoSignaturePublicKey.js +19 -41
- package/dist/signature/CryptoSignaturePublicKey.js.map +1 -1
- package/dist/signature/CryptoSignatureValidation.d.ts +10 -12
- package/dist/signature/CryptoSignatureValidation.js +13 -35
- package/dist/signature/CryptoSignatureValidation.js.map +1 -1
- package/dist/signature/CryptoSignatures.d.ts +1 -5
- package/dist/signature/CryptoSignatures.js +4 -4
- package/dist/signature/CryptoSignatures.js.map +1 -1
- package/dist/state/CryptoPrivateState.d.ts +7 -15
- package/dist/state/CryptoPrivateState.js +72 -76
- package/dist/state/CryptoPrivateState.js.map +1 -1
- package/dist/state/CryptoPrivateStateReceive.d.ts +2 -4
- package/dist/state/CryptoPrivateStateReceive.js +27 -39
- package/dist/state/CryptoPrivateStateReceive.js.map +1 -1
- package/dist/state/CryptoPrivateStateTransmit.d.ts +1 -2
- package/dist/state/CryptoPrivateStateTransmit.js +14 -40
- package/dist/state/CryptoPrivateStateTransmit.js.map +1 -1
- package/dist/state/CryptoPublicState.d.ts +5 -10
- package/dist/state/CryptoPublicState.js +42 -51
- package/dist/state/CryptoPublicState.js.map +1 -1
- package/dist/stream/CryptoStream.js +5 -2
- package/dist/stream/CryptoStream.js.map +1 -1
- package/dist/stream/CryptoStreamAddress.d.ts +3 -6
- package/dist/stream/CryptoStreamAddress.js +13 -29
- package/dist/stream/CryptoStreamAddress.js.map +1 -1
- package/dist/stream/CryptoStreamHeader.d.ts +5 -8
- package/dist/stream/CryptoStreamHeader.js +15 -18
- package/dist/stream/CryptoStreamHeader.js.map +1 -1
- package/dist/stream/CryptoStreamState.d.ts +3 -7
- package/dist/stream/CryptoStreamState.js +14 -32
- package/dist/stream/CryptoStreamState.js.map +1 -1
- package/lib-web/nmshd.crypto.js +701 -914
- package/lib-web/nmshd.crypto.js.map +1 -1
- package/lib-web/nmshd.crypto.min.js +1 -1
- package/lib-web/nmshd.crypto.min.js.map +1 -1
- package/package.json +3 -3
|
@@ -8,7 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var CryptoRelationshipPublicRequest_1;
|
|
12
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
12
|
exports.CryptoRelationshipPublicRequest = void 0;
|
|
14
13
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
@@ -16,25 +15,15 @@ const CoreBuffer_1 = require("../CoreBuffer");
|
|
|
16
15
|
const CryptoSerializable_1 = require("../CryptoSerializable");
|
|
17
16
|
const CryptoExchangePublicKey_1 = require("../exchange/CryptoExchangePublicKey");
|
|
18
17
|
const CryptoSignaturePublicKey_1 = require("../signature/CryptoSignaturePublicKey");
|
|
19
|
-
let CryptoRelationshipPublicRequest =
|
|
20
|
-
constructor(signatureKey, exchangeKey, ephemeralKey, nonce) {
|
|
21
|
-
super();
|
|
22
|
-
this.signatureKey = signatureKey;
|
|
23
|
-
this.exchangeKey = exchangeKey;
|
|
24
|
-
this.ephemeralKey = ephemeralKey;
|
|
25
|
-
this.nonce = nonce;
|
|
26
|
-
}
|
|
18
|
+
let CryptoRelationshipPublicRequest = class CryptoRelationshipPublicRequest extends CryptoSerializable_1.CryptoSerializable {
|
|
27
19
|
toJSON(verbose = true) {
|
|
28
|
-
|
|
20
|
+
return {
|
|
29
21
|
exc: this.exchangeKey.toJSON(false),
|
|
30
22
|
sig: this.signatureKey.toJSON(false),
|
|
31
23
|
eph: this.ephemeralKey.toJSON(false),
|
|
32
|
-
nnc: this.nonce.toBase64URL()
|
|
24
|
+
nnc: this.nonce.toBase64URL(),
|
|
25
|
+
"@type": verbose ? "CryptoRelationshipPublicRequest" : undefined
|
|
33
26
|
};
|
|
34
|
-
if (verbose) {
|
|
35
|
-
obj["@type"] = "CryptoRelationshipPublicRequest";
|
|
36
|
-
}
|
|
37
|
-
return obj;
|
|
38
27
|
}
|
|
39
28
|
clear() {
|
|
40
29
|
this.exchangeKey.clear();
|
|
@@ -43,25 +32,25 @@ let CryptoRelationshipPublicRequest = CryptoRelationshipPublicRequest_1 = class
|
|
|
43
32
|
this.nonce.clear();
|
|
44
33
|
}
|
|
45
34
|
static from(value) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
return this.fromAny(value);
|
|
36
|
+
}
|
|
37
|
+
static preFrom(value) {
|
|
38
|
+
if (value.exc) {
|
|
39
|
+
value = {
|
|
40
|
+
exchangeKey: value.exc,
|
|
41
|
+
signatureKey: value.sig,
|
|
42
|
+
ephemeralKey: value.eph,
|
|
43
|
+
nonce: value.nnc
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return value;
|
|
51
47
|
}
|
|
52
48
|
static fromJSON(value) {
|
|
53
|
-
|
|
54
|
-
const exchangeKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.exc);
|
|
55
|
-
const ephemeralKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.eph);
|
|
56
|
-
const nonce = CoreBuffer_1.CoreBuffer.fromBase64URL(value.nnc);
|
|
57
|
-
return new CryptoRelationshipPublicRequest_1(signatureKey, exchangeKey, ephemeralKey, nonce);
|
|
49
|
+
return this.fromAny(value);
|
|
58
50
|
}
|
|
59
51
|
static fromBase64(value) {
|
|
60
52
|
return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
|
|
61
53
|
}
|
|
62
|
-
static deserialize(value) {
|
|
63
|
-
return this.fromJSON(JSON.parse(value));
|
|
64
|
-
}
|
|
65
54
|
};
|
|
66
55
|
__decorate([
|
|
67
56
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
@@ -88,12 +77,8 @@ __decorate([
|
|
|
88
77
|
(0, ts_serval_1.serialize)(),
|
|
89
78
|
__metadata("design:type", CoreBuffer_1.CoreBuffer)
|
|
90
79
|
], CryptoRelationshipPublicRequest.prototype, "nonce", void 0);
|
|
91
|
-
CryptoRelationshipPublicRequest =
|
|
92
|
-
(0, ts_serval_1.type)("CryptoRelationshipPublicRequest")
|
|
93
|
-
__metadata("design:paramtypes", [CryptoSignaturePublicKey_1.CryptoSignaturePublicKey,
|
|
94
|
-
CryptoExchangePublicKey_1.CryptoExchangePublicKey,
|
|
95
|
-
CryptoExchangePublicKey_1.CryptoExchangePublicKey,
|
|
96
|
-
CoreBuffer_1.CoreBuffer])
|
|
80
|
+
CryptoRelationshipPublicRequest = __decorate([
|
|
81
|
+
(0, ts_serval_1.type)("CryptoRelationshipPublicRequest")
|
|
97
82
|
], CryptoRelationshipPublicRequest);
|
|
98
83
|
exports.CryptoRelationshipPublicRequest = CryptoRelationshipPublicRequest;
|
|
99
84
|
//# sourceMappingURL=CryptoRelationshipPublicRequest.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoRelationshipPublicRequest.js","sourceRoot":"","sources":["../../src/relationship/CryptoRelationshipPublicRequest.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CryptoRelationshipPublicRequest.js","sourceRoot":"","sources":["../../src/relationship/CryptoRelationshipPublicRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA2F;AAC3F,8CAAoE;AACpE,8DAA2D;AAC3D,iFAI6C;AAC7C,oFAI+C;AAmB/C,IAAa,+BAA+B,GAA5C,MAAa,+BACT,SAAQ,uCAAkB;IAuBV,MAAM,CAAC,OAAO,GAAG,IAAI;QACjC,OAAO;YACH,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;YACnC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC;YACpC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAA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AE;IACV,IAAA,qBAAS,GAAE;8BACQ,iDAAuB;oEAAC;AAI5C;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACS,iDAAuB;qEAAC;AAI7C;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACE,uBAAU;8DAAC;AAtBhB,+BAA+B;IAD3C,IAAA,gBAAI,EAAC,iCAAiC,CAAC;GAC3B,+BAA+B,CAmE3C;AAnEY,0EAA+B"}
|
|
@@ -22,12 +22,11 @@ export declare class CryptoRelationshipPublicResponse extends CryptoSerializable
|
|
|
22
22
|
signatureKey: CryptoSignaturePublicKey;
|
|
23
23
|
exchangeKey: CryptoExchangePublicKey;
|
|
24
24
|
state: CryptoPublicState;
|
|
25
|
-
constructor(signatureKey: CryptoSignaturePublicKey, exchangeKey: CryptoExchangePublicKey, state: CryptoPublicState);
|
|
26
25
|
toJSON(verbose?: boolean): ICryptoRelationshipPublicResponseSerialized;
|
|
27
26
|
clear(): void;
|
|
28
27
|
verify(content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
29
28
|
static from(value: CryptoRelationshipPublicResponse | ICryptoRelationshipPublicResponse): CryptoRelationshipPublicResponse;
|
|
29
|
+
protected static preFrom(value: any): any;
|
|
30
30
|
static fromJSON(value: ICryptoRelationshipPublicResponseSerialized): CryptoRelationshipPublicResponse;
|
|
31
31
|
static fromBase64(value: string): CryptoRelationshipPublicResponse;
|
|
32
|
-
static deserialize(value: string): CryptoRelationshipPublicResponse;
|
|
33
32
|
}
|
|
@@ -8,7 +8,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var CryptoRelationshipPublicResponse_1;
|
|
12
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
12
|
exports.CryptoRelationshipPublicResponse = void 0;
|
|
14
13
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
@@ -18,23 +17,15 @@ const CryptoExchangePublicKey_1 = require("../exchange/CryptoExchangePublicKey")
|
|
|
18
17
|
const CryptoSignaturePublicKey_1 = require("../signature/CryptoSignaturePublicKey");
|
|
19
18
|
const CryptoSignatures_1 = require("../signature/CryptoSignatures");
|
|
20
19
|
const CryptoPublicState_1 = require("../state/CryptoPublicState");
|
|
21
|
-
let CryptoRelationshipPublicResponse =
|
|
22
|
-
constructor(signatureKey, exchangeKey, state) {
|
|
23
|
-
super();
|
|
24
|
-
this.signatureKey = signatureKey;
|
|
25
|
-
this.exchangeKey = exchangeKey;
|
|
26
|
-
this.state = state;
|
|
27
|
-
}
|
|
20
|
+
let CryptoRelationshipPublicResponse = class CryptoRelationshipPublicResponse extends CryptoSerializable_1.CryptoSerializable {
|
|
28
21
|
toJSON(verbose = true) {
|
|
29
|
-
|
|
22
|
+
return {
|
|
30
23
|
exc: this.exchangeKey.toJSON(false),
|
|
31
24
|
sig: this.signatureKey.toJSON(false),
|
|
32
|
-
sta: this.state.toJSON(false)
|
|
25
|
+
sta: this.state.toJSON(false),
|
|
26
|
+
id: this.id,
|
|
27
|
+
"@type": verbose ? "CryptoRelationshipPublicResponse" : undefined
|
|
33
28
|
};
|
|
34
|
-
if (verbose) {
|
|
35
|
-
obj["@type"] = "CryptoRelationshipPublicResponse";
|
|
36
|
-
}
|
|
37
|
-
return obj;
|
|
38
29
|
}
|
|
39
30
|
clear() {
|
|
40
31
|
this.exchangeKey.clear();
|
|
@@ -45,23 +36,25 @@ let CryptoRelationshipPublicResponse = CryptoRelationshipPublicResponse_1 = clas
|
|
|
45
36
|
return await CryptoSignatures_1.CryptoSignatures.verify(content, signature, this.signatureKey);
|
|
46
37
|
}
|
|
47
38
|
static from(value) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
39
|
+
return this.fromAny(value);
|
|
40
|
+
}
|
|
41
|
+
static preFrom(value) {
|
|
42
|
+
if (value.exc) {
|
|
43
|
+
value = {
|
|
44
|
+
exchangeKey: value.exc,
|
|
45
|
+
signatureKey: value.sig,
|
|
46
|
+
state: value.sta,
|
|
47
|
+
id: value.id
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
return value;
|
|
52
51
|
}
|
|
53
52
|
static fromJSON(value) {
|
|
54
|
-
|
|
55
|
-
const exchangeKey = CryptoExchangePublicKey_1.CryptoExchangePublicKey.fromJSON(value.exc);
|
|
56
|
-
const state = CryptoPublicState_1.CryptoPublicState.fromJSON(value.sta);
|
|
57
|
-
return new CryptoRelationshipPublicResponse_1(signatureKey, exchangeKey, state);
|
|
53
|
+
return this.fromAny(value);
|
|
58
54
|
}
|
|
59
55
|
static fromBase64(value) {
|
|
60
56
|
return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
|
|
61
57
|
}
|
|
62
|
-
static deserialize(value) {
|
|
63
|
-
return this.fromJSON(JSON.parse(value));
|
|
64
|
-
}
|
|
65
58
|
};
|
|
66
59
|
__decorate([
|
|
67
60
|
(0, ts_serval_1.validate)({ nullable: true }),
|
|
@@ -83,11 +76,8 @@ __decorate([
|
|
|
83
76
|
(0, ts_serval_1.serialize)(),
|
|
84
77
|
__metadata("design:type", CryptoPublicState_1.CryptoPublicState)
|
|
85
78
|
], CryptoRelationshipPublicResponse.prototype, "state", void 0);
|
|
86
|
-
CryptoRelationshipPublicResponse =
|
|
87
|
-
(0, ts_serval_1.type)("CryptoRelationshipPublicResponse")
|
|
88
|
-
__metadata("design:paramtypes", [CryptoSignaturePublicKey_1.CryptoSignaturePublicKey,
|
|
89
|
-
CryptoExchangePublicKey_1.CryptoExchangePublicKey,
|
|
90
|
-
CryptoPublicState_1.CryptoPublicState])
|
|
79
|
+
CryptoRelationshipPublicResponse = __decorate([
|
|
80
|
+
(0, ts_serval_1.type)("CryptoRelationshipPublicResponse")
|
|
91
81
|
], CryptoRelationshipPublicResponse);
|
|
92
82
|
exports.CryptoRelationshipPublicResponse = CryptoRelationshipPublicResponse;
|
|
93
83
|
//# sourceMappingURL=CryptoRelationshipPublicResponse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoRelationshipPublicResponse.js","sourceRoot":"","sources":["../../src/relationship/CryptoRelationshipPublicResponse.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CryptoRelationshipPublicResponse.js","sourceRoot":"","sources":["../../src/relationship/CryptoRelationshipPublicResponse.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA2F;AAC3F,8CAAuD;AACvD,8DAA2D;AAC3D,iFAI6C;AAE7C,oFAI+C;AAC/C,oEAAiE;AACjE,kEAAiH;AAiBjH,IAAa,gCAAgC,GAA7C,MAAa,gCACT,SAAQ,uCAAkB;IAmBV,MAAM,CAAC,OAAO,GAAG,IAAI;QACjC,OAAO;YACH,GAAG,EAAE,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC;YACnC,GAAG,EAAE,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC;YACpC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC;YAC7B,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,kCAAkC,CAAC,CAAC,CAAC,SAAS;SACpE,CAAC;IACN,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,WAAW,CAAC,KAAK,EAAE,CAAC;QACzB,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;QAC1B,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;IACvB,CAAC;IAEM,KAAK,CAAC,MAAM,CAAC,OAAmB,EAAE,SAA0B;QAC/D,OAAO,MAAM,mCAAgB,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;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|
static from(value: ICryptoRelationshipRequestSecrets): CryptoRelationshipRequestSecrets;
|
|
33
|
-
static deserialize(value: string): CryptoRelationshipRequestSecrets;
|
|
34
33
|
sign(content: CoreBuffer, algorithm?: CryptoHashAlgorithm): Promise<CryptoSignature>;
|
|
35
34
|
verifyOwn(content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
36
35
|
verifyPeerIdentity(content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
@@ -27,10 +27,7 @@ const CryptoSignatures_1 = require("../signature/CryptoSignatures");
|
|
|
27
27
|
const CryptoRelationshipPublicRequest_1 = require("./CryptoRelationshipPublicRequest");
|
|
28
28
|
let CryptoRelationshipRequestSecrets = CryptoRelationshipRequestSecrets_1 = class CryptoRelationshipRequestSecrets extends CryptoSerializable_1.CryptoSerializable {
|
|
29
29
|
static from(value) {
|
|
30
|
-
return
|
|
31
|
-
}
|
|
32
|
-
static deserialize(value) {
|
|
33
|
-
return super.deserialize(value, CryptoRelationshipRequestSecrets_1);
|
|
30
|
+
return this.fromAny(value);
|
|
34
31
|
}
|
|
35
32
|
async sign(content, algorithm = 1 /* SHA256 */) {
|
|
36
33
|
return await CryptoSignatures_1.CryptoSignatures.sign(content, this.signatureKeypair.privateKey, algorithm);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoRelationshipRequestSecrets.js","sourceRoot":"","sources":["../../src/relationship/CryptoRelationshipRequestSecrets.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA8E;AAC9E,8CAAwD;AACxD,0DAAuD;AACvD,8DAA2D;AAE3D,qEAAkE;AAClE,mEAAkF;AAClF,+DAA4D;AAC5D,6EAAkG;AAClG,iFAAwG;AAExG,yDAAsD;AAEtD,gFAAsG;AACtG,oFAA4G;AAC5G,oEAAiE;AACjE,uFAAoF;AAcpF,IAAa,gCAAgC,wCAA7C,MAAa,gCAAiC,SAAQ,uCAAkB;IAiC7D,MAAM,CAAC,IAAI,CAAC,KAAwC;QACvD,OAAO,
|
|
1
|
+
{"version":3,"file":"CryptoRelationshipRequestSecrets.js","sourceRoot":"","sources":["../../src/relationship/CryptoRelationshipRequestSecrets.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA8E;AAC9E,8CAAwD;AACxD,0DAAuD;AACvD,8DAA2D;AAE3D,qEAAkE;AAClE,mEAAkF;AAClF,+DAA4D;AAC5D,6EAAkG;AAClG,iFAAwG;AAExG,yDAAsD;AAEtD,gFAAsG;AACtG,oFAA4G;AAC5G,oEAAiE;AACjE,uFAAoF;AAcpF,IAAa,gCAAgC,wCAA7C,MAAa,gCAAiC,SAAQ,uCAAkB;IAiC7D,MAAM,CAAC,IAAI,CAAC,KAAwC;QACvD,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAEM,KAAK,CAAC,IAAI,CACb,OAAmB,EACnB,0BAA2D;QAE3D,OAAO,MAAM,mCAAgB,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAC7F,CAAC;IAEM,KAAK,CAAC,SAAS,CAAC,OAAmB,EAAE,SAA0B;QAClE,OAAO,MAAM,mCAAgB,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,gBAAgB,CAAC,SAAS,CAAC,CAAC;IAC9F,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,OAAmB,EAAE,SAA0B;QAC3E,OAAO,MAAM,mCAAgB,CAAC,MAAM,CAAC,OAAO,EAAE,SAAS,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;IACnF,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,OAAmB;QAC3C,OAAO,MAAM,mCAAgB,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;IACnE,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,MAAoB;QAC5C,OAAO,MA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,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;;4DACO;AAInB;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACJ,6CAAqB;yEAAC;AAI9C;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACH,6CAAqB;0EAAC;AAI/C;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACH,+CAAsB;0EAAC;AAIhD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACJ,mDAAwB;yEAAC;AAIjD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACJ,iDAAuB;yEAAC;AAIhD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACV,iCAAe;mEAAC;AAIlC;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACd,uBAAU;+DAAC;AA/BhB,gCAAgC;IAD5C,IAAA,gBAAI,EAAC,kCAAkC,CAAC;GAC5B,gCAAgC,CA8F5C;AA9FY,4EAAgC"}
|
|
@@ -42,7 +42,6 @@ export declare class CryptoRelationshipSecrets extends CryptoSerializable implem
|
|
|
42
42
|
peerIdentityKey?: CryptoSignaturePublicKey;
|
|
43
43
|
requestSecretKey: CryptoSecretKey;
|
|
44
44
|
static from(value: ICryptoRelationshipSecrets): CryptoRelationshipSecrets;
|
|
45
|
-
static deserialize(value: string): CryptoRelationshipSecrets;
|
|
46
45
|
sign(content: CoreBuffer, algorithm?: CryptoHashAlgorithm): Promise<CryptoSignature>;
|
|
47
46
|
verifyOwn(content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
48
47
|
verifyPeer(content: CoreBuffer, signature: CryptoSignature): Promise<boolean>;
|
|
@@ -31,10 +31,7 @@ const CryptoRelationshipPublicResponse_1 = require("./CryptoRelationshipPublicRe
|
|
|
31
31
|
const CryptoRelationshipType_1 = require("./CryptoRelationshipType");
|
|
32
32
|
let CryptoRelationshipSecrets = CryptoRelationshipSecrets_1 = class CryptoRelationshipSecrets extends CryptoSerializable_1.CryptoSerializable {
|
|
33
33
|
static from(value) {
|
|
34
|
-
return
|
|
35
|
-
}
|
|
36
|
-
static deserialize(value) {
|
|
37
|
-
return super.deserialize(value, CryptoRelationshipSecrets_1);
|
|
34
|
+
return this.fromAny(value);
|
|
38
35
|
}
|
|
39
36
|
async sign(content, algorithm = 1 /* SHA256 */) {
|
|
40
37
|
return await CryptoSignatures_1.CryptoSignatures.sign(content, this.signatureKeypair.privateKey, algorithm);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoRelationshipSecrets.js","sourceRoot":"","sources":["../../src/relationship/CryptoRelationshipSecrets.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,kDAA8E;AAE9E,0DAAuD;AACvD,gDAA6C;AAC7C,wDAAqD;AACrD,8DAA2D;AAE3D,qEAA6F;AAC7F,mEAAkF;AAClF,+DAA4D;AAC5D,6EAAkG;AAClG,iFAAwG;AAGxG,gFAAsG;AACtG,oFAA4G;AAC5G,oEAAiE;AAEjE,kFAA+E;AAC/E,oFAAiF;AACjF,8DAA2D;AAE3D,yFAAsF;AAEtF,qEAAkE;AAiBlE,IAAa,yBAAyB,iCAAtC,MAAa,yBAA0B,SAAQ,uCAAkB;IA6CtD,MAAM,CAAC,IAAI,CAAC,KAAiC;QAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"CryptoRelationshipSecrets.js","sourceRoot":"","sources":["../../src/relationship/CryptoRelationsh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C,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACH,+CAAsB;mEAAC;AAIhD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;8BACL,uDAA0B;gEAAC;AAIjD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;8BACN,qDAAyB;+DAAC;AAI/C;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACJ,iDAAuB;kEAAC;AAIhD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACH,mDAAwB;mEAAC;AAIlD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACJ,iDAAuB;kEAAC;AAIhD;IAFC,IAAA,oBAAQ,EAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACH,mDAAwB;kEAAC;AAIlD;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,EAAC,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;8BACH,iCAAe;mEAAC;AA3ChC,yBAAyB;IADrC,IAAA,gBAAI,EAAC,2BAA2B,CAAC;GACrB,yBAAyB,CAqNrC;AArNY,8DAAyB"}
|
|
@@ -15,15 +15,14 @@ export interface ICryptoSignature extends ISerializable {
|
|
|
15
15
|
id?: string;
|
|
16
16
|
}
|
|
17
17
|
export declare class CryptoSignature extends CryptoSerializable implements ICryptoSignature, IClearable {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
constructor(signature: CoreBuffer, algorithm: CryptoHashAlgorithm, keyId?: string, id?: string);
|
|
18
|
+
signature: CoreBuffer;
|
|
19
|
+
algorithm: CryptoHashAlgorithm;
|
|
20
|
+
keyId?: string;
|
|
21
|
+
id?: string;
|
|
23
22
|
toJSON(verbose?: boolean): ICryptoSignatureSerialized;
|
|
24
23
|
clear(): void;
|
|
25
24
|
static from(value: CryptoSignature | ICryptoSignature): CryptoSignature;
|
|
25
|
+
static preFrom(value: any): any;
|
|
26
26
|
static fromJSON(value: ICryptoSignatureSerialized): CryptoSignature;
|
|
27
27
|
static fromBase64(value: string): CryptoSignature;
|
|
28
|
-
static deserialize(value: string): CryptoSignature;
|
|
29
28
|
}
|
|
@@ -8,28 +8,13 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var CryptoSignature_1;
|
|
12
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
12
|
exports.CryptoSignature = void 0;
|
|
14
13
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
15
14
|
const CoreBuffer_1 = require("../CoreBuffer");
|
|
16
15
|
const CryptoSerializable_1 = require("../CryptoSerializable");
|
|
17
16
|
const CryptoSignatureValidation_1 = require("./CryptoSignatureValidation");
|
|
18
|
-
let CryptoSignature =
|
|
19
|
-
constructor(signature, algorithm, keyId, id) {
|
|
20
|
-
let error;
|
|
21
|
-
error = CryptoSignatureValidation_1.CryptoSignatureValidation.checkHashAlgorithm(algorithm);
|
|
22
|
-
if (error)
|
|
23
|
-
throw error;
|
|
24
|
-
error = CryptoSignatureValidation_1.CryptoSignatureValidation.checkSignatureAsBuffer(signature);
|
|
25
|
-
if (error)
|
|
26
|
-
throw error;
|
|
27
|
-
super();
|
|
28
|
-
this.signature = signature;
|
|
29
|
-
this.algorithm = algorithm;
|
|
30
|
-
this.keyId = keyId;
|
|
31
|
-
this.id = id;
|
|
32
|
-
}
|
|
17
|
+
let CryptoSignature = class CryptoSignature extends CryptoSerializable_1.CryptoSerializable {
|
|
33
18
|
toJSON(verbose = true) {
|
|
34
19
|
const obj = {
|
|
35
20
|
sig: this.signature.toBase64URL(),
|
|
@@ -44,29 +29,48 @@ let CryptoSignature = CryptoSignature_1 = class CryptoSignature extends CryptoSe
|
|
|
44
29
|
this.signature.clear();
|
|
45
30
|
}
|
|
46
31
|
static from(value) {
|
|
47
|
-
return
|
|
32
|
+
return this.fromAny(value);
|
|
33
|
+
}
|
|
34
|
+
static preFrom(value) {
|
|
35
|
+
if (value.sig) {
|
|
36
|
+
value = {
|
|
37
|
+
signature: value.sig,
|
|
38
|
+
algorithm: value.alg
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
CryptoSignatureValidation_1.CryptoSignatureValidation.checkSignature(value.signature);
|
|
42
|
+
CryptoSignatureValidation_1.CryptoSignatureValidation.checkHashAlgorithm(value.algorithm);
|
|
43
|
+
return value;
|
|
48
44
|
}
|
|
49
45
|
static fromJSON(value) {
|
|
50
|
-
|
|
51
|
-
if (error)
|
|
52
|
-
throw error;
|
|
53
|
-
error = CryptoSignatureValidation_1.CryptoSignatureValidation.checkSignatureAsString(value.sig);
|
|
54
|
-
if (error)
|
|
55
|
-
throw error;
|
|
56
|
-
const buffer = CoreBuffer_1.CoreBuffer.fromBase64URL(value.sig);
|
|
57
|
-
return new CryptoSignature_1(buffer, value.alg);
|
|
46
|
+
return this.fromAny(value);
|
|
58
47
|
}
|
|
59
48
|
static fromBase64(value) {
|
|
60
49
|
return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
|
|
61
50
|
}
|
|
62
|
-
static deserialize(value) {
|
|
63
|
-
const obj = JSON.parse(value);
|
|
64
|
-
return this.fromJSON(obj);
|
|
65
|
-
}
|
|
66
51
|
};
|
|
67
|
-
|
|
68
|
-
(0, ts_serval_1.
|
|
69
|
-
|
|
52
|
+
__decorate([
|
|
53
|
+
(0, ts_serval_1.validate)(),
|
|
54
|
+
(0, ts_serval_1.serialize)(),
|
|
55
|
+
__metadata("design:type", CoreBuffer_1.CoreBuffer)
|
|
56
|
+
], CryptoSignature.prototype, "signature", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, ts_serval_1.validate)(),
|
|
59
|
+
(0, ts_serval_1.serialize)(),
|
|
60
|
+
__metadata("design:type", Number)
|
|
61
|
+
], CryptoSignature.prototype, "algorithm", void 0);
|
|
62
|
+
__decorate([
|
|
63
|
+
(0, ts_serval_1.validate)({ nullable: true }),
|
|
64
|
+
(0, ts_serval_1.serialize)(),
|
|
65
|
+
__metadata("design:type", String)
|
|
66
|
+
], CryptoSignature.prototype, "keyId", void 0);
|
|
67
|
+
__decorate([
|
|
68
|
+
(0, ts_serval_1.validate)({ nullable: true }),
|
|
69
|
+
(0, ts_serval_1.serialize)(),
|
|
70
|
+
__metadata("design:type", String)
|
|
71
|
+
], CryptoSignature.prototype, "id", void 0);
|
|
72
|
+
CryptoSignature = __decorate([
|
|
73
|
+
(0, ts_serval_1.type)("CryptoSignature")
|
|
70
74
|
], CryptoSignature);
|
|
71
75
|
exports.CryptoSignature = CryptoSignature;
|
|
72
76
|
//# sourceMappingURL=CryptoSignature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoSignature.js","sourceRoot":"","sources":["../../src/signature/CryptoSignature.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CryptoSignature.js","sourceRoot":"","sources":["../../src/signature/CryptoSignature.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA2F;AAC3F,8CAAuD;AACvD,8DAA2D;AAE3D,2EAAwE;AAiBxE,IAAa,eAAe,GAA5B,MAAa,eAAgB,SAAQ,uCAAkB;IAiBnC,MAAM,CAAC,OAAO,GAAG,IAAI;QACjC,MAAM,GAAG,GAA+B;YACpC,GAAG,EAAE,IAAI,CAAC,SAA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AAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;IAC5B,IAAA,qBAAS,GAAE;;2CACO;AAfV,eAAe;IAD3B,IAAA,gBAAI,EAAC,iBAAiB,CAAC;GACX,eAAe,CAyD3B;AAzDY,0CAAe"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CryptoSignatureAlgorithm.js","sourceRoot":"","sources":["../../src/signature/CryptoSignatureAlgorithm.ts"],"names":[],"mappings":""}
|
|
@@ -12,13 +12,12 @@ export interface ICryptoSignatureKeypair extends ISerializable {
|
|
|
12
12
|
privateKey: ICryptoSignaturePrivateKey;
|
|
13
13
|
}
|
|
14
14
|
export declare class CryptoSignatureKeypair extends CryptoSerializable implements ICryptoSignatureKeypair, IClearable {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
constructor(publicKey: CryptoSignaturePublicKey, privateKey: CryptoSignaturePrivateKey);
|
|
15
|
+
publicKey: CryptoSignaturePublicKey;
|
|
16
|
+
privateKey: CryptoSignaturePrivateKey;
|
|
18
17
|
toJSON(verbose?: boolean): ICryptoSignatureKeypairSerialized;
|
|
19
18
|
clear(): void;
|
|
20
19
|
static from(value: CryptoSignatureKeypair | ICryptoSignatureKeypair): CryptoSignatureKeypair;
|
|
20
|
+
protected static preFrom(value: any): any;
|
|
21
21
|
static fromJSON(value: ICryptoSignatureKeypairSerialized): CryptoSignatureKeypair;
|
|
22
22
|
static fromBase64(value: string): CryptoSignatureKeypair;
|
|
23
|
-
static deserialize(value: string): CryptoSignatureKeypair;
|
|
24
23
|
}
|
|
@@ -8,59 +8,61 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
|
|
|
8
8
|
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
9
|
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
10
|
};
|
|
11
|
-
var CryptoSignatureKeypair_1;
|
|
12
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
12
|
exports.CryptoSignatureKeypair = void 0;
|
|
14
13
|
const ts_serval_1 = require("@js-soft/ts-serval");
|
|
15
14
|
const CoreBuffer_1 = require("../CoreBuffer");
|
|
15
|
+
const CryptoError_1 = require("../CryptoError");
|
|
16
|
+
const CryptoErrorCode_1 = require("../CryptoErrorCode");
|
|
16
17
|
const CryptoSerializable_1 = require("../CryptoSerializable");
|
|
17
18
|
const CryptoSignaturePrivateKey_1 = require("./CryptoSignaturePrivateKey");
|
|
18
19
|
const CryptoSignaturePublicKey_1 = require("./CryptoSignaturePublicKey");
|
|
19
|
-
|
|
20
|
-
let CryptoSignatureKeypair = CryptoSignatureKeypair_1 = class CryptoSignatureKeypair extends CryptoSerializable_1.CryptoSerializable {
|
|
21
|
-
constructor(publicKey, privateKey) {
|
|
22
|
-
const error = CryptoSignatureValidation_1.CryptoSignatureValidation.checkSignatureKeypair(privateKey, publicKey);
|
|
23
|
-
if (error)
|
|
24
|
-
throw error;
|
|
25
|
-
super();
|
|
26
|
-
this.publicKey = publicKey;
|
|
27
|
-
this.privateKey = privateKey;
|
|
28
|
-
}
|
|
20
|
+
let CryptoSignatureKeypair = class CryptoSignatureKeypair extends CryptoSerializable_1.CryptoSerializable {
|
|
29
21
|
toJSON(verbose = true) {
|
|
30
|
-
|
|
22
|
+
return {
|
|
31
23
|
pub: this.publicKey.toJSON(false),
|
|
32
|
-
prv: this.privateKey.toJSON(false)
|
|
24
|
+
prv: this.privateKey.toJSON(false),
|
|
25
|
+
"@type": verbose ? "CryptoSignatureKeypair" : undefined
|
|
33
26
|
};
|
|
34
|
-
if (verbose) {
|
|
35
|
-
obj["@type"] = "CryptoSignatureKeypair";
|
|
36
|
-
}
|
|
37
|
-
return obj;
|
|
38
27
|
}
|
|
39
28
|
clear() {
|
|
40
29
|
this.publicKey.clear();
|
|
41
30
|
this.privateKey.clear();
|
|
42
31
|
}
|
|
43
32
|
static from(value) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
33
|
+
return this.fromAny(value);
|
|
34
|
+
}
|
|
35
|
+
static preFrom(value) {
|
|
36
|
+
if (value.pub) {
|
|
37
|
+
value = {
|
|
38
|
+
publicKey: value.pub,
|
|
39
|
+
privateKey: value.prv
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
if (value.privateKey.algorithm !== value.publicKey.algorithm) {
|
|
43
|
+
throw new CryptoError_1.CryptoError(CryptoErrorCode_1.CryptoErrorCode.SignatureWrongAlgorithm, "Algorithms of private and public key do not match.");
|
|
44
|
+
}
|
|
45
|
+
return value;
|
|
47
46
|
}
|
|
48
47
|
static fromJSON(value) {
|
|
49
|
-
|
|
50
|
-
const publicKey = CryptoSignaturePublicKey_1.CryptoSignaturePublicKey.fromJSON(value.pub);
|
|
51
|
-
return new CryptoSignatureKeypair_1(publicKey, privateKey);
|
|
48
|
+
return this.fromAny(value);
|
|
52
49
|
}
|
|
53
50
|
static fromBase64(value) {
|
|
54
51
|
return this.deserialize(CoreBuffer_1.CoreBuffer.base64_utf8(value));
|
|
55
52
|
}
|
|
56
|
-
static deserialize(value) {
|
|
57
|
-
const obj = JSON.parse(value);
|
|
58
|
-
return this.fromJSON(obj);
|
|
59
|
-
}
|
|
60
53
|
};
|
|
61
|
-
|
|
62
|
-
(0, ts_serval_1.
|
|
63
|
-
|
|
54
|
+
__decorate([
|
|
55
|
+
(0, ts_serval_1.validate)(),
|
|
56
|
+
(0, ts_serval_1.serialize)(),
|
|
57
|
+
__metadata("design:type", CryptoSignaturePublicKey_1.CryptoSignaturePublicKey)
|
|
58
|
+
], CryptoSignatureKeypair.prototype, "publicKey", void 0);
|
|
59
|
+
__decorate([
|
|
60
|
+
(0, ts_serval_1.validate)(),
|
|
61
|
+
(0, ts_serval_1.serialize)(),
|
|
62
|
+
__metadata("design:type", CryptoSignaturePrivateKey_1.CryptoSignaturePrivateKey)
|
|
63
|
+
], CryptoSignatureKeypair.prototype, "privateKey", void 0);
|
|
64
|
+
CryptoSignatureKeypair = __decorate([
|
|
65
|
+
(0, ts_serval_1.type)("CryptoSignatureKeypair")
|
|
64
66
|
], CryptoSignatureKeypair);
|
|
65
67
|
exports.CryptoSignatureKeypair = CryptoSignatureKeypair;
|
|
66
68
|
//# sourceMappingURL=CryptoSignatureKeypair.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CryptoSignatureKeypair.js","sourceRoot":"","sources":["../../src/signature/CryptoSignatureKeypair.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"CryptoSignatureKeypair.js","sourceRoot":"","sources":["../../src/signature/CryptoSignatureKeypair.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,kDAA2F;AAC3F,8CAAuD;AACvD,gDAA6C;AAC7C,wDAAqD;AACrD,8DAA2D;AAC3D,2EAIqC;AACrC,yEAIoC;AAapC,IAAa,sBAAsB,GAAnC,MAAa,sBAAuB,SAAQ,uCAAkB;IAS1C,MAAM,CAAC,OAAO,GAAG,IAAI;QACjC,OAAO;YACH,GAAG,EAAE,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC;YACjC,GAAG,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC;YAClC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC,SAAS;SAC1D,CAAC;IACN,CAAC;IAEM,KAAK;QACR,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC;QACvB,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;IAC5B,CAAC;IAEM,MAAM,CAAC,IAAI,CAAC,KAAuD;QACtE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAES,MAAM,CAAU,OAAO,CAAC,KAAU;QACxC,IAAI,KAAK,CAAC,GAAG,EAAE;YACX,KAAK,GAAG;gBACJ,SAAS,EAAE,KAAK,CAAC,GAAG;gBACpB,UAAU,EAAE,KAAK,CAAC,GAAG;aACxB,CAAC;SACL;QAED,IAAI,KAAK,CAAC,UAAU,CAAC,SAAS,KAAK,KAAK,CAAC,SAAS,CAAC,SAAS,EAAE;YAC1D,MAAM,IAAI,yBAAW,CACjB,iCAAe,CAAC,uBAAuB,EACvC,oDAAoD,CACvD,CAAC;SACL;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAEM,MAAM,CAAC,QAAQ,CAAC,KAAwC;QAC3D,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAEM,MAAM,CAAC,UAAU,CAAC,KAAa;QAClC,OAAO,IAAI,CAAC,WAAW,CAAC,uBAAU,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC;IAC3D,CAAC;CACJ,CAAA;AAhDG;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACM,mDAAwB;yDAAC;AAI3C;IAFC,IAAA,oBAAQ,GAAE;IACV,IAAA,qBAAS,GAAE;8BACO,qDAAyB;0DAAC;AAPpC,sBAAsB;IADlC,IAAA,gBAAI,EAAC,wBAAwB,CAAC;GAClB,sBAAsB,CAmDlC;AAnDY,wDAAsB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ISerializable, ISerialized } from "@js-soft/ts-serval";
|
|
2
|
-
import {
|
|
2
|
+
import { IClearable, ICoreBuffer } from "../CoreBuffer";
|
|
3
3
|
import { CryptoPrivateKey } from "../CryptoPrivateKey";
|
|
4
|
+
import { CryptoSignatureAlgorithm } from "./CryptoSignatureAlgorithm";
|
|
4
5
|
import { CryptoSignaturePublicKey } from "./CryptoSignaturePublicKey";
|
|
5
|
-
import { CryptoSignatureAlgorithm } from "./CryptoSignatures";
|
|
6
6
|
export interface ICryptoSignaturePrivateKeySerialized extends ISerialized {
|
|
7
7
|
alg: number;
|
|
8
8
|
prv: string;
|
|
@@ -14,17 +14,14 @@ export interface ICryptoSignaturePrivateKey extends ISerializable {
|
|
|
14
14
|
id?: string;
|
|
15
15
|
}
|
|
16
16
|
export declare class CryptoSignaturePrivateKey extends CryptoPrivateKey implements ICryptoSignaturePrivateKey, IClearable {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
readonly id?: string;
|
|
20
|
-
constructor(algorithm: CryptoSignatureAlgorithm, privateKey: CoreBuffer, id?: string);
|
|
17
|
+
algorithm: CryptoSignatureAlgorithm;
|
|
18
|
+
id?: string;
|
|
21
19
|
toJSON(verbose?: boolean): ICryptoSignaturePrivateKeySerialized;
|
|
22
20
|
clear(): void;
|
|
23
|
-
serialize(verbose?: boolean): string;
|
|
24
21
|
toBase64(verbose?: boolean): string;
|
|
25
22
|
toPublicKey(): Promise<CryptoSignaturePublicKey>;
|
|
26
23
|
static from(value: CryptoSignaturePrivateKey | ICryptoSignaturePrivateKey): CryptoSignaturePrivateKey;
|
|
24
|
+
static preFrom(value: any): any;
|
|
27
25
|
static fromJSON(value: ICryptoSignaturePrivateKeySerialized): CryptoSignaturePrivateKey;
|
|
28
26
|
static fromBase64(value: string): CryptoSignaturePrivateKey;
|
|
29
|
-
static deserialize(value: string): CryptoSignaturePrivateKey;
|
|
30
27
|
}
|