Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
특정 서명을 사용하여 PDF 파일이 서명되었는지 확인하려면 PdfFileSignature 클래스의 VerifySigned 메서드를 사용하세요. 이 메서드는 서명 이름을 요구하며, PDF가 해당 서명 이름으로 서명된 경우 true를 반환합니다. 어떤 서명으로 서명되었는지 확인하지 않고도 PDF가 서명되었는지 확인할 수 있습니다.
다음 코드 조각은 주어진 서명을 사용하여 PDF가 서명되었는지 확인하는 방법을 보여줍니다.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void IsPdfSigned()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_SecuritySignatures();
using (var pdFileSignature = new Aspose.Pdf.Facades.PdfFileSignature())
{
// Bind PDF document
pdFileSignature.BindPdf(dataDir + "signed_rsa.pdf");
if (pdFileSignature.ContainsSignature())
{
Console.WriteLine("Document Signed");
}
}
}
서명 이름을 제공하지 않고 파일이 서명되었는지 확인하려면 다음 코드를 사용하세요.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void IsPdfSignedWithGivenSignature()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_SecuritySignatures();
using (var pdFileSignature = new Aspose.Pdf.Facades.PdfFileSignature())
{
// Bind PDF document
pdFileSignature.BindPdf(dataDir + "signed_rsa.pdf");
if (pdFileSignature.VerifySignature("Signature1"))
{
Console.WriteLine("PDF Signed");
}
}
}
VerifySignature 메서드는 PdfFileSignature 클래스의 특정 서명을 검증할 수 있게 해줍니다. 이 메서드는 서명 이름을 입력으로 요구하며, 서명이 유효한 경우 true를 반환합니다. 다음 코드 조각은 서명을 검증하는 방법을 보여줍니다.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void IsPdfSignatureValid()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf_SecuritySignatures();
using (var pdFileSignature = new Aspose.Pdf.Facades.PdfFileSignature())
{
// Bind PDF document
pdFileSignature.BindPdf(dataDir + "signed_rsa.pdf");
if (pdFileSignature.VerifySignature("Signature1"))
{
Console.WriteLine("Signature Verified");
}
}
}
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.