MCPcopy Index your code
hub / github.com/nodeSolidServer/node-solid-server / verify

Function verify

lib/webid/lib/verify.mjs:8–25  ·  view source on GitHub ↗
(certificateObj, callback)

Source from the content-addressed store, hash-verified

6const SPARQL_QUERY = 'PREFIX cert: <http://www.w3.org/ns/auth/cert#> SELECT ?webid ?m ?e WHERE { ?webid cert:key ?key . ?key cert:modulus ?m . ?key cert:exponent ?e . }'
7
8export function verify (certificateObj, callback) {
9 if (!certificateObj) {
10 return callback(new Error('No certificate given'))
11 }
12 const uris = getUris(certificateObj)
13 if (uris.length === 0) {
14 return callback(new Error('Empty Subject Alternative Name field in certificate'))
15 }
16 const uri = uris.shift()
17 get(uri, function (err, body, contentType) {
18 if (err) {
19 return callback(err)
20 }
21 verifyKey(certificateObj, uri, body, contentType, function (err, success) {
22 return callback(err, uri)
23 })
24 })
25}
26
27function getUris (certificateObj) {
28 const uris = []

Callers

nothing calls this directly

Calls 3

getUrisFunction · 0.85
getFunction · 0.85
verifyKeyFunction · 0.85

Tested by

no test coverage detected