|
@@ -77,19 +77,20 @@ public class DigitalSignaturesTest extends PDFSamples {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * Create pfx format certificate for digital signature use
|
|
|
- *
|
|
|
- * Password: ComPDFKit
|
|
|
- * C=SG: This represents the country code "SG," which typically stands for Singapore.
|
|
|
- * O=ComPDFKit: This is the Organization (O) field, indicating the name of the organization or entity,
|
|
|
- * in this case, "ComPDFKit."
|
|
|
- * D=R&D Department: This is the Department (D) field,
|
|
|
+ * <b>Create pfx format certificate for digital signature use</b> <br>
|
|
|
+ * <br><br>
|
|
|
+ * <b>Password:</b> ComPDFKit <br>
|
|
|
+ * <b>C=SG:</b> This represents the country code "SG," which typically stands for Singapore.<br><br>
|
|
|
+ * <b>O=ComPDFKit:</b> This is the Organization (O) field, indicating the name of the organization or entity,
|
|
|
+ * in this case, "ComPDFKit." <br><br>
|
|
|
+ * <b>D=R&D Department:</b> This is the Department (D) field,
|
|
|
* indicating the specific department within the organization,
|
|
|
- * in this case, "R&D Department."
|
|
|
- * CN=Alan: This is the Common Name (CN) field, which usually represents the name
|
|
|
- * of the individual or entity. In this case, it is "Alan."
|
|
|
- *
|
|
|
- *
|
|
|
+ * in this case, "R&D Department."<br><br>
|
|
|
+ * <b>CN=Alan:</b> This is the Common Name (CN) field, which usually represents the name
|
|
|
+ * of the individual or entity. In this case, it is "Alan."<br><br>
|
|
|
+ * <b>emailAddress=xxxx@example.com:</b> Email is xxxx@example.com <br><br>
|
|
|
+ * <b>CPDFSignature.CertUsage.PDFAll: </b>Used for both digital signing and data validation simultaneously.<br><br>
|
|
|
+ * <b>is_2048: </b> Enhanced security encryption.<br><br>
|
|
|
*/
|
|
|
private void generateCertificate() {
|
|
|
outputListener.println("generate certificate");
|
|
@@ -99,7 +100,7 @@ public class DigitalSignaturesTest extends PDFSamples {
|
|
|
ownerInfo.setOrgnize("ComPDFKit");
|
|
|
ownerInfo.setEmail("xxxx@example.com");
|
|
|
ownerInfo.setCountry("SG");
|
|
|
- CPDFSignature.CertUsage flag = CPDFSignature.CertUsage.PDFDigSig;
|
|
|
+ CPDFSignature.CertUsage flag = CPDFSignature.CertUsage.PDFAll;
|
|
|
File certFile = new File(outputDir(), "certificate/Certificate.pfx");
|
|
|
certFile.getParentFile().mkdirs();
|
|
|
|
|
@@ -112,6 +113,7 @@ public class DigitalSignaturesTest extends PDFSamples {
|
|
|
printDividingLine();
|
|
|
}
|
|
|
|
|
|
+
|
|
|
private void createSignature() {
|
|
|
outputListener.println("Create digital signature.");
|
|
|
|