A digital signature validates the authenticity and integrity of electronic documents the same a signature or stamp (produced by hand) does. However, a digital signature is considerably more secure than a handwritten signature.

By the time you are done reading this article, you will have learned how to use Java to add a digital signature to a PowerPoint presentation.

Java API to Add Digital Signature to PowerPoint PPT

If you are looking to add a digital signature to a PPT presentation with just a few lines of Java code, then you need:

  • Aspose.Slides for Java, a powerful PowerPoint library used to create, edit, and manipulate PPT and PPTX presentations. For instructions on installing Aspose.Slides, see this Installation guide.
  • A signing certificate: Before you create a digital signature, you need a signing certificate first. Such certificates are typically issued by known certification authorities (CA), but you can also create your own certificate.

A digital signature must meet these criteria: use a valid signature, the certificate associated with it must be current (not expired), and (ideally) it should come from a reputable or well-known certificate authority, and the signer or signing organization must be trusted.

Java Code to Add Digital Signature to PPT

디지털 인증서가 있고 시스템에 Aspose.Slides가 설치되어 있으면 다음 지침에 따라 Java로 된 PowerPoint 프레젠테이션에 디지털 서명을 추가해야 합니다.

  1. 프레젠테이션 클래스를 이용하여 해당 파워포인트 파일을 불러옵니다.
  2. 디지털 서명 개체를 만든 다음 디지털 서명 PFX 파일과 암호를 전달합니다.
  3. 디지털 서명을 추가합니다.
  4. 변경된 프레젠테이션을 저장합니다.

이 Java 코드는 PowerPoint에 디지털 서명을 추가하는 방법을 보여줍니다.

// 프레젠테이션 파일을 엽니다.
Presentation pres = new Presentation();
try {
    // PFX 파일 및 PFX 암호를 사용하여 DigitalSignature 개체를 만듭니다. 
    DigitalSignature signature = new DigitalSignature("testsignature1.pfx", "testpass1");

    // 댓글 새 디지털 서명
    signature.setComments("Aspose.Slides digital signing test.");

    // 프레젠테이션에 디지털 서명 추가
    pres.getDigitalSignatures().add(signature);

    // 프레젠테이션을 저장합니다
    pres.save("SomePresentationSigned.pptx", SaveFormat.Pptx);
} finally {
    pres.dispose();
}

디지털 서명된 PowerPoint PPT 확인

디지털 서명이 있는 파워포인트를 받으면 본인의 손에 있는 파일이 서명된 후 수정되지 않았는지 확인하는 확인 작업을 실행합니다. 이 프로세스는 본질적으로 PPT 또는 PPTX 프레젠테이션의 진정성과 무결성을 테스트합니다.

디지털 서명으로 서명된 PowerPoint를 확인하려면 다음 지침을 따르십시오.

  1. 프레젠테이션 클래스를 이용하여 해당 파워포인트 파일을 불러옵니다.
  2. PowerPoint가 서명되었는지 확인합니다.
  3. 서명(프레젠테이션에 서명하는 데 사용됨)이 유효한지 확인합니다.

이 Java 코드를 실행하여 디지털 서명된 PowerPoint 문서를 확인합니다.

// 프레젠테이션을 엽니다
Presentation pres = new Presentation("SomePresentationSigned.pptx");
try {
    if (pres.getDigitalSignatures().size() > 0)
    {
        boolean allSignaturesAreValid = true;

        System.out.println("Signatures used to sign the presentation: ");

        // 모든 디지털 서명이 유효한지 확인합니다.
       for (IDigitalSignature signature : pres.getDigitalSignatures())
        {
            System.out.println(signature.getComments() + ", "
                    + signature.getSignTime().toString() + " -- " + (signature.isValid() ? "VALID" : "INVALID"));
            allSignaturesAreValid &= signature.isValid();
        }

        if (allSignaturesAreValid)
            System.out.println("Presentation is genuine. All signatures are valid.");
        else
            System.out.println("Presentation has been modified since signing.");
    }
} finally {
    if (pres != null) pres.dispose();
}

무료 라이선스 받기

Aspose.Slides 기능을 제한 없이 사용해 보고 싶다면 무료 임시 라이선스를 받는 것이 좋습니다.

결론

이제 Java를 사용하여 PowerPoint 프레젠테이션에 디지털 서명을 추가하는 방법을 알게 되셨을 것입니다. PowerPoint 암호로 보호하기 프레젠테이션과 같은 기타 보안 주제 문서가 도움이 될 수 있습니다.

Aspose.Slides 기능에 대한 자세한 내용은 문서. 질문이 있는 경우 포럼에 질문을 게시할 수 있습니다.