翻譯|使用教程|編輯:張瑩心|2021-11-09 10:21:56.160|閱讀 249 次
概述:使用數(shù)字簽名簽名的 PowerPoint 文檔可以幫助收件人檢查自簽名后是否已更改。如果進(jìn)行任何更改,簽名將立即失效。因此,在編輯 PowerPoint 文檔之前,您應(yīng)該檢查它是否已經(jīng)過數(shù)字簽名。在本文中,您將學(xué)習(xí)如何使用Spire.Presentation for Java以編程方式在 Java 中完成此任務(wù)。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
Spire.Presentation for Java 專業(yè)的 PowerPoint API,它允許開發(fā)人員在 Java 應(yīng)用程序中創(chuàng)建、讀取、寫入、轉(zhuǎn)換和保存 PowerPoint 文檔,而無需安裝 Microsoft PowerPoint。
可點(diǎn)擊此處下載最新版測試。
使用數(shù)字簽名簽名的 PowerPoint 文檔可以幫助收件人檢查自簽名后是否已更改。如果進(jìn)行任何更改,簽名將立即失效。因此,在編輯 PowerPoint 文檔之前,您應(yīng)該檢查它是否已經(jīng)過數(shù)字簽名。在本文中,您將學(xué)習(xí)如何使用Spire.Presentation for Java以編程方式在 Java 中完成此任務(wù)。
驗證 PowerPoint 文檔是否經(jīng)過數(shù)字簽名
Spire.Presentation for Java 提供了Presentation.isDigitallySigned()方法來檢測 PowerPoint 文檔是否經(jīng)過數(shù)字簽名。如果該方法返回 true,則表示文檔已進(jìn)行數(shù)字簽名。
以下是實現(xiàn)該功能的詳細(xì)步驟:
import com.spire.presentation.Presentation;
public class VerifyIfPPTisDigitallySigned {
public static void main(String []args) throws Exception {
//Create a Presentation instance
Presentation ppt = new Presentation();
//Load a PowerPoint document
ppt.loadFromFile("Sample.pptx");
//Verify if the document is digitally signed or not
if (ppt.isDigitallySigned()) {
System.out.println("This document is digitally signed");
} else {
System.out.println("This document is not digitally signed");
}
}
}
慧都是E-iceblue官方友好合作伙伴,如果您對spire.Presentation感興趣,可以了解具體授權(quán)價格和使用機(jī)制。
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn