@tdxvolt/volt-client-grpc 0.15.0 → 0.16.0-beta.1
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/lib/index.cjs +114 -95
- package/package.json +3 -3
- package/protobuf/tdx/volt_api/data/v1/sqlite_database_api.proto +2 -2
- package/protobuf/tdx/volt_api/volt/v1/file_api.proto +2 -0
- package/protobuf/tdx/volt_api/volt/v1/ssi.proto +40 -0
- package/protobuf/tdx/volt_api/volt/v1/ssi_api.proto +126 -0
- package/protobuf/tdx/volt_api/volt/v1/volt.proto +117 -60
- package/protobuf/tdx/volt_api/volt/v1/volt_api.proto +127 -29
- package/src/constants.js +14 -14
- package/src/grpc-call.js +31 -33
- package/src/utils.js +22 -2
- package/src/volt-client-internal.js +205 -18
- package/src/volt-client.js +16 -4
- package/src/volt-credential.js +3 -2
- package/protobuf/tdx/volt_api/ssi/v1/ssi_api.proto +0 -37
package/src/volt-credential.js
CHANGED
|
@@ -241,12 +241,13 @@ export class VoltCredential {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
static rsaEncrypt(key, buffer) {
|
|
244
|
-
|
|
244
|
+
const cipher = crypto.publicEncrypt(key, buffer);
|
|
245
|
+
return cipher.toString("base64url");
|
|
245
246
|
}
|
|
246
247
|
|
|
247
248
|
static rsaDecrypt(key, buffer) {
|
|
248
249
|
const keyObj = crypto.createPrivateKey(key);
|
|
249
|
-
const cipher = Buffer.from(buffer, "
|
|
250
|
+
const cipher = Buffer.from(buffer, "base64url");
|
|
250
251
|
return Buffer.from(crypto.privateDecrypt(keyObj, cipher));
|
|
251
252
|
}
|
|
252
253
|
}
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
syntax = "proto3";
|
|
2
|
-
|
|
3
|
-
package tdx.volt_api.ssi.v1;
|
|
4
|
-
|
|
5
|
-
import "tdx/volt_api/volt/v1/status.proto";
|
|
6
|
-
|
|
7
|
-
// Volt DIDs are essentially 'peer DIDs', i.e. they are not globally resolvable.
|
|
8
|
-
// TDX DIDs are globally resolvable.
|
|
9
|
-
|
|
10
|
-
service SsiAPI {
|
|
11
|
-
rpc ResolveDID(ResolveDIDRequest) returns (ResolveDIDResponse);
|
|
12
|
-
rpc TrustVerifiableCredential(TrustVerifiableCredentialRequest) returns (TrustVerifiableCredentialResponse);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
// Do we need to support/differentiate between plain DIDs and DID urls here?
|
|
17
|
-
// Where a DID url is a DID followed by some additional lookup info,
|
|
18
|
-
// e.g. did:tdx:volt:92181ffa-072a-452a-ae79-a243ab2812fc;service=/some/service?query#fragment
|
|
19
|
-
//
|
|
20
|
-
message ResolveDIDRequest {
|
|
21
|
-
string did_url = 1;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
message ResolveDIDResponse {
|
|
25
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
26
|
-
string did_document_json = 2;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Empty ATM - a VC is issued for the authenticated identity.
|
|
30
|
-
message TrustVerifiableCredentialRequest {
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
message TrustVerifiableCredentialResponse {
|
|
34
|
-
tdx.volt_api.volt.v1.Status status = 1;
|
|
35
|
-
string verifiable_credential_json = 2;
|
|
36
|
-
}
|
|
37
|
-
|