MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / register

Method register

modules/crypt/ssl/ssl_cert.js:269–277  ·  view source on GitHub ↗
(cert)

Source from the content-addressed store, hash-verified

267 return (new pk(spki, false, [] /* any oid */)).verify((new Crypt.Digest(hash)).process(x509.tbs), sig);
268 }
269 register(cert) {
270 if (this.#verify) {
271 let validity = X509.decodeTBS(X509.decode(new Uint8Array(cert)).tbs).validity, now = Date.now();
272 if (!((validity.from < now) && (now < validity.to)))
273 throw new Error("date validation failed");
274 }
275
276 this.#registeredCerts.push(cert);
277 }
278 getDH() {
279 let dh = getResource("dh.der");
280 let ber = new BER(dh);

Callers 3

constructorMethod · 0.95
unpacketizeFunction · 0.80
testFunction · 0.80

Calls 2

decodeMethod · 0.65
pushMethod · 0.45

Tested by 1

testFunction · 0.64