INNER CODE UNIT · JavaScript
checkRPID
mylofi/webauthn-local-client · src/walc.js:720
async function checkRPID(rpIDHash,origRPID) {
var originHash = await computeSHA256Hash(
fromUTF8String(origRPID)
);
return (
rpIDHash.length > 0 &&
rpIDHash.byteLength == originHash.byteLength &&
rpIDHash.toString() == originHash.toString()
);
}
function parseSignature(algoCOSE,signature) {
if (isPublicKeyAlgorithm("ES256",algoCOSE)) {
// this algorithm's signature comes back ASN.1 encoded, per spec:
// https://www.w3.org/TR/webauthn-2/#sctn-signature-attestation-types
let der = ASN1.parseVerbose(signature);
return new Uint8Array([ ...der.children[0].value, ...der.children[1].value, ]);
}