avancement planning
This commit is contained in:
+5
@@ -32,6 +32,10 @@ function verifyCertificateChain(timestamp, leaf, certificateAuthorities) {
|
||||
});
|
||||
}
|
||||
class CertificateChainVerifier {
|
||||
untrustedCert;
|
||||
trustedCerts;
|
||||
localCerts;
|
||||
timestamp;
|
||||
constructor(opts) {
|
||||
this.untrustedCert = opts.untrustedCert;
|
||||
this.trustedCerts = opts.trustedCerts;
|
||||
@@ -123,6 +127,7 @@ class CertificateChainVerifier {
|
||||
// or issuer/subject. Potential issuers are added to the result array.
|
||||
this.localCerts.forEach((possibleIssuer) => {
|
||||
if (keyIdentifier) {
|
||||
/* istanbul ignore else */
|
||||
if (possibleIssuer.extSubjectKeyID) {
|
||||
if (possibleIssuer.extSubjectKeyID.keyIdentifier.equals(keyIdentifier)) {
|
||||
issuers.push(possibleIssuer);
|
||||
|
||||
+8
@@ -56,9 +56,17 @@ function getSigner(cert) {
|
||||
else {
|
||||
issuer = cert.extension(OID_FULCIO_ISSUER_V1)?.value.toString('ascii');
|
||||
}
|
||||
const oids = cert.extensions.map((ext) => {
|
||||
const oid = ext.subs[0].toOID();
|
||||
return {
|
||||
oid: { id: oid.split('.').map(Number) },
|
||||
value: ext.subs[ext.subs.length - 1].value,
|
||||
};
|
||||
});
|
||||
const identity = {
|
||||
extensions: { issuer },
|
||||
subjectAlternativeName: cert.subjectAltName,
|
||||
oids,
|
||||
};
|
||||
return {
|
||||
key: core_1.crypto.createPublicKey(cert.publicKey),
|
||||
|
||||
Reference in New Issue
Block a user