@spacesprotocol/libveritas 0.0.0-dev.20260322184924 → 0.0.0-dev.20260322235210
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/libveritas.d.ts +9 -7
- package/libveritas.js +35 -21
- package/libveritas_bg.wasm +0 -0
- package/package.json +1 -1
package/libveritas.d.ts
CHANGED
|
@@ -221,14 +221,9 @@ export class VerifiedMessage {
|
|
|
221
221
|
free(): void;
|
|
222
222
|
[Symbol.dispose](): void;
|
|
223
223
|
/**
|
|
224
|
-
*
|
|
225
|
-
* Returns null if the handle was not verified.
|
|
224
|
+
* All certificates as serialized byte arrays.
|
|
226
225
|
*/
|
|
227
|
-
|
|
228
|
-
/**
|
|
229
|
-
* All certificates as a JS array.
|
|
230
|
-
*/
|
|
231
|
-
certificates(): any;
|
|
226
|
+
certificates(): Uint8Array[];
|
|
232
227
|
/**
|
|
233
228
|
* Get the verified message for rebroadcasting or updating.
|
|
234
229
|
*/
|
|
@@ -262,6 +257,13 @@ export class Veritas {
|
|
|
262
257
|
verifyWithOptions(ctx: QueryContext, msg: Message, options: number): VerifiedMessage;
|
|
263
258
|
}
|
|
264
259
|
|
|
260
|
+
/**
|
|
261
|
+
* Create a .spacecert file from a subject name and certificate bytes.
|
|
262
|
+
*
|
|
263
|
+
* Collects certificates from multiple verified messages into a single chain.
|
|
264
|
+
*/
|
|
265
|
+
export function createCertificateChain(subject: string, cert_bytes_list: Uint8Array[]): Uint8Array;
|
|
266
|
+
|
|
265
267
|
/**
|
|
266
268
|
* Decode stored zone bytes to a plain JS object.
|
|
267
269
|
*/
|
package/libveritas.js
CHANGED
|
@@ -609,30 +609,14 @@ class VerifiedMessage {
|
|
|
609
609
|
wasm.__wbg_verifiedmessage_free(ptr, 0);
|
|
610
610
|
}
|
|
611
611
|
/**
|
|
612
|
-
*
|
|
613
|
-
*
|
|
614
|
-
* @param {string} handle
|
|
615
|
-
* @returns {any}
|
|
616
|
-
*/
|
|
617
|
-
certificate(handle) {
|
|
618
|
-
const ptr0 = passStringToWasm0(handle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
619
|
-
const len0 = WASM_VECTOR_LEN;
|
|
620
|
-
const ret = wasm.verifiedmessage_certificate(this.__wbg_ptr, ptr0, len0);
|
|
621
|
-
if (ret[2]) {
|
|
622
|
-
throw takeFromExternrefTable0(ret[1]);
|
|
623
|
-
}
|
|
624
|
-
return takeFromExternrefTable0(ret[0]);
|
|
625
|
-
}
|
|
626
|
-
/**
|
|
627
|
-
* All certificates as a JS array.
|
|
628
|
-
* @returns {any}
|
|
612
|
+
* All certificates as serialized byte arrays.
|
|
613
|
+
* @returns {Uint8Array[]}
|
|
629
614
|
*/
|
|
630
615
|
certificates() {
|
|
631
616
|
const ret = wasm.verifiedmessage_certificates(this.__wbg_ptr);
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
return takeFromExternrefTable0(ret[0]);
|
|
617
|
+
var v1 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice();
|
|
618
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 4, 4);
|
|
619
|
+
return v1;
|
|
636
620
|
}
|
|
637
621
|
/**
|
|
638
622
|
* Get the verified message for rebroadcasting or updating.
|
|
@@ -773,6 +757,29 @@ class Veritas {
|
|
|
773
757
|
if (Symbol.dispose) Veritas.prototype[Symbol.dispose] = Veritas.prototype.free;
|
|
774
758
|
exports.Veritas = Veritas;
|
|
775
759
|
|
|
760
|
+
/**
|
|
761
|
+
* Create a .spacecert file from a subject name and certificate bytes.
|
|
762
|
+
*
|
|
763
|
+
* Collects certificates from multiple verified messages into a single chain.
|
|
764
|
+
* @param {string} subject
|
|
765
|
+
* @param {Uint8Array[]} cert_bytes_list
|
|
766
|
+
* @returns {Uint8Array}
|
|
767
|
+
*/
|
|
768
|
+
function createCertificateChain(subject, cert_bytes_list) {
|
|
769
|
+
const ptr0 = passStringToWasm0(subject, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
770
|
+
const len0 = WASM_VECTOR_LEN;
|
|
771
|
+
const ptr1 = passArrayJsValueToWasm0(cert_bytes_list, wasm.__wbindgen_malloc);
|
|
772
|
+
const len1 = WASM_VECTOR_LEN;
|
|
773
|
+
const ret = wasm.createCertificateChain(ptr0, len0, ptr1, len1);
|
|
774
|
+
if (ret[3]) {
|
|
775
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
776
|
+
}
|
|
777
|
+
var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
778
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
779
|
+
return v3;
|
|
780
|
+
}
|
|
781
|
+
exports.createCertificateChain = createCertificateChain;
|
|
782
|
+
|
|
776
783
|
/**
|
|
777
784
|
* Decode stored zone bytes to a plain JS object.
|
|
778
785
|
* @param {Uint8Array} bytes
|
|
@@ -963,6 +970,10 @@ function __wbg_get_imports() {
|
|
|
963
970
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
964
971
|
return ret;
|
|
965
972
|
},
|
|
973
|
+
__wbg_new_with_length_825018a1616e9e55: function(arg0) {
|
|
974
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
975
|
+
return ret;
|
|
976
|
+
},
|
|
966
977
|
__wbg_parse_e9eddd2a82c706eb: function() { return handleError(function (arg0, arg1) {
|
|
967
978
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
968
979
|
return ret;
|
|
@@ -978,6 +989,9 @@ function __wbg_get_imports() {
|
|
|
978
989
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
979
990
|
return ret;
|
|
980
991
|
}, arguments); },
|
|
992
|
+
__wbg_set_8c0b3ffcf05d61c2: function(arg0, arg1, arg2) {
|
|
993
|
+
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
994
|
+
},
|
|
981
995
|
__wbg_stringify_5ae93966a84901ac: function() { return handleError(function (arg0) {
|
|
982
996
|
const ret = JSON.stringify(arg0);
|
|
983
997
|
return ret;
|
package/libveritas_bg.wasm
CHANGED
|
Binary file
|