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

Function decodeSKI

modules/crypt/etc/x509.js:155–169  ·  view source on GitHub ↗
(buf)

Source from the content-addressed store, hash-verified

153 throw new Error("x509: bad SPKI");
154 },
155 decodeSKI(buf) {
156 let ski = this.decodeExtension(buf, [2, 5, 29, 14]);
157 if (ski) {
158 // must be a OCTET STRING
159 let ber = new BER(ski);
160 return ber.getOctetString()
161 }
162 // make up SKI by SHA1(SPK)
163 let spk = this.getSPK(buf);
164 if (!spk)
165 throw new Error("x509: no SPK!?");
166 const digest = new Digest("SHA1");
167 digest.write(spk);
168 return digest.close();
169 },
170 decodeAKI(buf) {
171 let aki = this.decodeExtension(buf, [2, 5, 29, 35]);
172 if (aki) {

Callers

nothing calls this directly

Calls 3

getOctetStringMethod · 0.95
writeMethod · 0.95
closeMethod · 0.95

Tested by

no test coverage detected