$76 GRAYBYTE WORDPRESS FILE MANAGER $88

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/sigstore/dist/

HOME
Current File : /opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/node_modules.bundled/sigstore/dist//sign.js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Signer = void 0;
const util_1 = require("./util");
class Signer {
    constructor(options) {
        this.identityProviders = [];
        this.ca = options.ca;
        this.tlog = options.tlog;
        this.identityProviders = options.identityProviders;
        this.signer = options.signer || this.signWithEphemeralKey.bind(this);
    }
    async signBlob(payload) {
        // Get signature and verification material for payload
        const sigMaterial = await this.signer(payload);
        // Calculate artifact digest
        const digest = util_1.crypto.hash(payload);
        // Create Rekor entry
        return this.tlog.createMessageSignatureEntry(digest, sigMaterial);
    }
    async signAttestation(payload, payloadType) {
        // Pre-authentication encoding to be signed
        const paeBuffer = util_1.dsse.preAuthEncoding(payloadType, payload);
        // Get signature and verification material for pae
        const sigMaterial = await this.signer(paeBuffer);
        const envelope = {
            payloadType,
            payload: payload,
            signatures: [
                {
                    keyid: sigMaterial.key?.id || '',
                    sig: sigMaterial.signature,
                },
            ],
        };
        return this.tlog.createDSSEEntry(envelope, sigMaterial);
    }
    async signWithEphemeralKey(payload) {
        // Create emphemeral key pair
        const keypair = util_1.crypto.generateKeyPair();
        // Retrieve identity token from one of the supplied identity providers
        const identityToken = await this.getIdentityToken();
        // Extract challenge claim from OIDC token
        const subject = util_1.oidc.extractJWTSubject(identityToken);
        // Construct challenge value by encrypting subject with private key
        const challenge = util_1.crypto.signBlob(Buffer.from(subject), keypair.privateKey);
        // Create signing certificate
        const certificates = await this.ca.createSigningCertificate(identityToken, keypair.publicKey, challenge);
        // Generate artifact signature
        const signature = util_1.crypto.signBlob(payload, keypair.privateKey);
        return {
            signature,
            certificates,
            key: undefined,
        };
    }
    async getIdentityToken() {
        const aggErrs = [];
        for (const provider of this.identityProviders) {
            try {
                const token = await provider.getToken();
                if (token) {
                    return token;
                }
            }
            catch (err) {
                aggErrs.push(err);
            }
        }
        throw new Error(`Identity token providers failed: ${aggErrs}`);
    }
}
exports.Signer = Signer;

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
ca
--
31 Aug 2024 8.02 AM
root / root
0755
cli
--
31 Aug 2024 8.02 AM
root / root
0755
client
--
31 Aug 2024 8.02 AM
root / root
0755
identity
--
31 Aug 2024 8.02 AM
root / root
0755
merkle
--
31 Aug 2024 8.02 AM
root / root
0755
tlog
--
31 Aug 2024 8.02 AM
root / root
0755
tuf
--
31 Aug 2024 8.02 AM
root / root
0755
types
--
31 Aug 2024 8.02 AM
root / root
0755
util
--
31 Aug 2024 8.02 AM
root / root
0755
x509
--
31 Aug 2024 8.02 AM
root / root
0755
error.d.ts
0.352 KB
7 Dec 2023 1.07 AM
root / root
0644
error.js
1.283 KB
7 Dec 2023 1.07 AM
root / root
0644
index.d.ts
0.039 KB
7 Dec 2023 1.07 AM
root / root
0644
index.js
1.714 KB
7 Dec 2023 1.07 AM
root / root
0644
sign.d.ts
0.668 KB
7 Dec 2023 1.07 AM
root / root
0644
sign.js
2.769 KB
7 Dec 2023 1.07 AM
root / root
0644
sigstore-utils.d.ts
0.394 KB
7 Dec 2023 1.07 AM
root / root
0644
sigstore-utils.js
2.288 KB
7 Dec 2023 1.07 AM
root / root
0644
sigstore.d.ts
1.351 KB
7 Dec 2023 1.07 AM
root / root
0644
sigstore.js
6.85 KB
7 Dec 2023 1.07 AM
root / root
0644
verify.d.ts
0.55 KB
7 Dec 2023 1.07 AM
root / root
0644
verify.js
6.594 KB
7 Dec 2023 1.07 AM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF