जावास्क्रिप्ट में प्रस्तुतियों में डिजिटल हस्ताक्षर जोड़ें

परिचय

डिजिटल प्रमाणपत्र का उपयोग पासवर्ड संरक्षित पावरपॉइंट प्रस्तुति बनाने के लिए किया जाता है, जिसे किसी विशेष संगठन या व्यक्ति द्वारा बनाया गया चिह्नित किया जाता है। डिजिटल प्रमाणपत्र को अधिकृत संगठन - प्रमाणपत्र प्राधिकरण से संपर्क करके प्राप्त किया जा सकता है। सिस्टम में डिजिटल प्रमाणपत्र स्थापित करने के बाद, इसे File -> Info -> Protect Presentation के माध्यम से प्रस्तुति में डिजिटल हस्ताक्षर जोड़ने के लिए उपयोग किया जा सकता है:

todo:image_alt_text

प्रस्तुति में एक से अधिक डिजिटल हस्ताक्षर हो सकते हैं। जब डिजिटल हस्ताक्षर प्रस्तुति में जोड़ा जाता है, तो पावरपॉइंट में एक विशेष संदेश प्रदर्शित होगा:

todo:image_alt_text

प्रस्तुति पर हस्ताक्षर करने या प्रस्तुति हस्ताक्षरों की प्रामाणिकता जांचने के लिए, Aspose.Slides API DigitalSignature क्लास, DigitalSignatureCollection क्लास और Presentation.getDigitalSignatures मेथड प्रदान करता है। वर्तमान में, डिजिटल हस्ताक्षर केवल PPTX फ़ॉर्मेट के लिए समर्थित हैं।

PFX प्रमाणपत्र से डिजिटल हस्ताक्षर जोड़ें

नीचे दिया गया कोड उदाहरण दिखाता है कि PFX प्रमाणपत्र से डिजिटल हस्ताक्षर कैसे जोड़ा जाए:

  1. PFX फ़ाइल खोलें और PFX पासवर्ड को DigitalSignature ऑब्जेक्ट में पास करें।
  2. निर्मित हस्ताक्षर को प्रस्तुति ऑब्जेक्ट में जोड़ें।
// प्रेजेंटेशन फ़ाइल खोल रहा है
var pres = new aspose.slides.Presentation();
try {
    // PFX फ़ाइल और PFX पासवर्ड के साथ DigitalSignature ऑब्जेक्ट बनाएं
    var signature = new aspose.slides.DigitalSignature("testsignature1.pfx", "testpass1");
    // नए डिजिटल हस्ताक्षर के लिए टिप्पणी सेट करें
    signature.setComments("Aspose.Slides digital signing test.");
    // प्रेजेंटेशन में डिजिटल हस्ताक्षर जोड़ें
    pres.getDigitalSignatures().add(signature);
    // प्रेजेंटेशन सहेजें
    pres.save("SomePresentationSigned.pptx", aspose.slides.SaveFormat.Pptx);
} finally {
    pres.dispose();
}

अब यह जाँचना संभव है कि प्रस्तुति डिजिटल रूप से हस्ताक्षरित है और संशोधित नहीं हुई है:

// प्रस्तुति खोलें
var pres = new aspose.slides.Presentation("SomePresentationSigned.pptx");
try {
    if (pres.getDigitalSignatures().size() > 0) {
        var allSignaturesAreValid = true;
        console.log("Signatures used to sign the presentation: ");
        // सभी डिजिटल हस्ताक्षर वैध हैं या नहीं जांचें
        for (let i = 0; i < pres.getDigitalSignatures().size(); i++) {
        let signature = pres.getDigitalSignatures().get_Item(i);
            console.log((((signature.getComments() + ", ") + signature.getSignTime().toString()) + " -- ") + (signature.isValid() ? "VALID" : "INVALID"));
            allSignaturesAreValid &= signature.isValid();
        }
        if (allSignaturesAreValid) {
            console.log("Presentation is genuine, all signatures are valid.");
        } else {
            console.log("Presentation has been modified since signing.");
        }
    }
} finally {
    if (pres != null) {
        pres.dispose();
    }
}

अक्सर पूछे जाने वाले प्रश्न

क्या मैं फ़ाइल से मौजूदा हस्ताक्षर हटा सकता हूँ?

Yes. The digital signatures collection supports व्यक्तिगत आइटम हटाना और पूरी तरह से साफ़ करना; after you save the file, the presentation will have no signatures.

फ़ाइल साइन करने के बाद “रीड-ऑनली” हो जाती है क्या?

No. A signature preserves integrity and authorship but does not block edits. To restrict editing, combine it with “Read-only” or a password.

क्या विभिन्न PowerPoint संस्करणों में हस्ताक्षर सही रूप से दिखेगा?

The signature is created for the OOXML (PPTX) container. Modern versions of PowerPoint that support OOXML signatures display the status of such signatures correctly.