$62 GRAYBYTE WORDPRESS FILE MANAGER $80

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/node_modules.bundled/@tufjs/models/dist/

HOME
Current File : /opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/node_modules.bundled/@tufjs/models/dist//key.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Key = void 0;
const util_1 = __importDefault(require("util"));
const error_1 = require("./error");
const utils_1 = require("./utils");
const key_1 = require("./utils/key");
// A container class representing the public portion of a Key.
class Key {
    constructor(options) {
        const { keyID, keyType, scheme, keyVal, unrecognizedFields } = options;
        this.keyID = keyID;
        this.keyType = keyType;
        this.scheme = scheme;
        this.keyVal = keyVal;
        this.unrecognizedFields = unrecognizedFields || {};
    }
    // Verifies the that the metadata.signatures contains a signature made with
    // this key and is correctly signed.
    verifySignature(metadata) {
        const signature = metadata.signatures[this.keyID];
        if (!signature)
            throw new error_1.UnsignedMetadataError('no signature for key found in metadata');
        if (!this.keyVal.public)
            throw new error_1.UnsignedMetadataError('no public key found');
        const publicKey = (0, key_1.getPublicKey)({
            keyType: this.keyType,
            scheme: this.scheme,
            keyVal: this.keyVal.public,
        });
        const signedData = metadata.signed.toJSON();
        try {
            if (!utils_1.crypto.verifySignature(signedData, publicKey, signature.sig)) {
                throw new error_1.UnsignedMetadataError(`failed to verify ${this.keyID} signature`);
            }
        }
        catch (error) {
            if (error instanceof error_1.UnsignedMetadataError) {
                throw error;
            }
            throw new error_1.UnsignedMetadataError(`failed to verify ${this.keyID} signature`);
        }
    }
    equals(other) {
        if (!(other instanceof Key)) {
            return false;
        }
        return (this.keyID === other.keyID &&
            this.keyType === other.keyType &&
            this.scheme === other.scheme &&
            util_1.default.isDeepStrictEqual(this.keyVal, other.keyVal) &&
            util_1.default.isDeepStrictEqual(this.unrecognizedFields, other.unrecognizedFields));
    }
    toJSON() {
        return {
            keytype: this.keyType,
            scheme: this.scheme,
            keyval: this.keyVal,
            ...this.unrecognizedFields,
        };
    }
    static fromJSON(keyID, data) {
        const { keytype, scheme, keyval, ...rest } = data;
        if (typeof keytype !== 'string') {
            throw new TypeError('keytype must be a string');
        }
        if (typeof scheme !== 'string') {
            throw new TypeError('scheme must be a string');
        }
        if (!utils_1.guard.isStringRecord(keyval)) {
            throw new TypeError('keyval must be a string record');
        }
        return new Key({
            keyID,
            keyType: keytype,
            scheme,
            keyVal: keyval,
            unrecognizedFields: rest,
        });
    }
}
exports.Key = Key;

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
31 Aug 2024 8.02 AM
root / root
0755
utils
--
31 Aug 2024 8.02 AM
root / root
0755
base.js
3.191 KB
7 Dec 2023 1.07 AM
root / root
0644
delegations.js
3.874 KB
7 Dec 2023 1.07 AM
root / root
0644
error.js
1.188 KB
7 Dec 2023 1.07 AM
root / root
0644
file.js
6.458 KB
7 Dec 2023 1.07 AM
root / root
0644
index.js
1.864 KB
7 Dec 2023 1.07 AM
root / root
0644
key.js
3.079 KB
7 Dec 2023 1.07 AM
root / root
0644
metadata.js
6.06 KB
7 Dec 2023 1.07 AM
root / root
0644
role.js
11.015 KB
7 Dec 2023 1.07 AM
root / root
0644
root.js
4.104 KB
7 Dec 2023 1.07 AM
root / root
0644
signature.js
0.994 KB
7 Dec 2023 1.07 AM
root / root
0644
snapshot.js
2.339 KB
7 Dec 2023 1.07 AM
root / root
0644
targets.js
2.988 KB
7 Dec 2023 1.07 AM
root / root
0644
timestamp.js
1.956 KB
7 Dec 2023 1.07 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF