@credo-ts/core 0.5.0-alpha.117 → 0.5.0-alpha.119
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.
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isValidK256JwkPublicKey = exports.K256Jwk = void 0;
|
|
4
4
|
const utils_1 = require("../../../utils");
|
|
5
5
|
const KeyType_1 = require("../../KeyType");
|
|
6
6
|
const jwa_1 = require("../jwa");
|
|
@@ -44,7 +44,7 @@ class K256Jwk extends Jwk_1.Jwk {
|
|
|
44
44
|
return Object.assign(Object.assign({}, super.toJson()), { crv: this.crv, x: this.x, y: this.y });
|
|
45
45
|
}
|
|
46
46
|
static fromJson(jwkJson) {
|
|
47
|
-
if (!
|
|
47
|
+
if (!isValidK256JwkPublicKey(jwkJson)) {
|
|
48
48
|
throw new Error("Invalid 'K-256' JWK.");
|
|
49
49
|
}
|
|
50
50
|
return new K256Jwk({
|
|
@@ -66,7 +66,7 @@ exports.K256Jwk = K256Jwk;
|
|
|
66
66
|
K256Jwk.supportedEncryptionAlgorithms = [];
|
|
67
67
|
K256Jwk.supportedSignatureAlgorithms = [alg_1.JwaSignatureAlgorithm.ES256K];
|
|
68
68
|
K256Jwk.keyType = KeyType_1.KeyType.K256;
|
|
69
|
-
function
|
|
69
|
+
function isValidK256JwkPublicKey(jwk) {
|
|
70
70
|
return ((0, validate_1.hasKty)(jwk, jwa_1.JwaKeyType.EC) &&
|
|
71
71
|
(0, validate_1.hasCrv)(jwk, jwa_1.JwaCurve.Secp256k1) &&
|
|
72
72
|
(0, validate_1.hasX)(jwk) &&
|
|
@@ -76,5 +76,5 @@ function isValidP256JwkPublicKey(jwk) {
|
|
|
76
76
|
supportsSigning: true,
|
|
77
77
|
}));
|
|
78
78
|
}
|
|
79
|
-
exports.
|
|
79
|
+
exports.isValidK256JwkPublicKey = isValidK256JwkPublicKey;
|
|
80
80
|
//# sourceMappingURL=K256Jwk.js.map
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@credo-ts/core",
|
|
3
3
|
"main": "build/index",
|
|
4
4
|
"types": "build/index",
|
|
5
|
-
"version": "0.5.0-alpha.
|
|
5
|
+
"version": "0.5.0-alpha.119+c9a985ec",
|
|
6
6
|
"files": [
|
|
7
7
|
"build"
|
|
8
8
|
],
|
|
@@ -67,5 +67,5 @@
|
|
|
67
67
|
"tslog": "^4.8.2",
|
|
68
68
|
"typescript": "~4.9.5"
|
|
69
69
|
},
|
|
70
|
-
"gitHead": "
|
|
70
|
+
"gitHead": "c9a985eca6ef15ef7b1e0e2931d0300b8087f8dd"
|
|
71
71
|
}
|