@@ -32,12 +32,12 @@ let field: PdfSignatureField = new PdfSignatureField(page, 'Signature', {
3232});
3333// Create a new signature using PFX data and private key
3434let sign: PdfSignature = PdfSignature.create(
35+ certData,
36+ password,
3537 {
3638 cryptographicStandard: CryptographicStandard.cms,
3739 digestAlgorithm: DigestAlgorithm.sha256
38- },
39- certData,
40- password
40+ }
4141);
4242// Set the signature to the field
4343field.setSignature(sign);
@@ -60,7 +60,7 @@ var form = document.form;
6060// Create a new signature field
6161var field = new ej.pdf.PdfSignatureField(page, 'Signature', {x: 10, y: 10, width: 100, height: 50});
6262// Create a new signature using PFX data and private key
63- var sign = ej.pdf.PdfSignature.create({cryptographicStandard: ej.pdf.CryptographicStandard.cms, digestAlgorithm: ej.pdf.DigestAlgorithm.sha256}, certData, password );
63+ var sign = ej.pdf.PdfSignature.create(certData, password, {cryptographicStandard: ej.pdf.CryptographicStandard.cms, digestAlgorithm: ej.pdf.DigestAlgorithm.sha256});
6464// Set the signature to the field
6565field.setSignature(sign);
6666// Add the field into PDF form
@@ -94,12 +94,12 @@ let field: PdfSignatureField = new PdfSignatureField(page, 'Signature', {
9494});
9595// Create a new signature using PFX data and private key
9696let sign: PdfSignature = PdfSignature.create(
97+ certData,
98+ password,
9799 {
98100 cryptographicStandard: CryptographicStandard.cms,
99101 digestAlgorithm: DigestAlgorithm.sha256
100- },
101- certData,
102- password
102+ }
103103);
104104// Set the signature to the field
105105field.setSignature(sign);
@@ -128,12 +128,12 @@ var field = new ej.pdf.PdfSignatureField(page, 'Signature', {
128128});
129129// Create a new signature using PFX data and private key
130130var sign = ej.pdf.PdfSignature.create(
131+ certData,
132+ password,
131133 {
132134 cryptographicStandard: ej.pdf.CryptographicStandard.cms,
133135 digestAlgorithm: ej.pdf.DigestAlgorithm.sha256
134- },
135- certData,
136- password
136+ }
137137);
138138// Set the signature to the field
139139field.setSignature(sign);
@@ -875,12 +875,12 @@ let externalSignatureCallback = (
875875};
876876// Create a new signature using external signing with public certificate collection
877877let signature: PdfSignature = PdfSignature.create(
878+ externalSignatureCallback,
879+ publicCertificates,
878880 {
879881 cryptographicStandard: CryptographicStandard.cms,
880882 algorithm: DigestAlgorithm.sha256
881- },
882- externalSignatureCallback,
883- publicCertificates
883+ }
884884);
885885// Set the signature to the field
886886field.setSignature(signature);
@@ -921,12 +921,12 @@ var externalSignatureCallback = function (data, options) {
921921};
922922// Create a new signature using external signing with public certificate collection
923923var signature = ej.pdf.PdfSignature.create(
924+ externalSignatureCallback,
925+ publicCertificates,
924926 {
925927 cryptographicStandard: ej.pdf.CryptographicStandard.cms,
926928 algorithm: ej.pdf.DigestAlgorithm.sha256
927- },
928- externalSignatureCallback,
929- publicCertificates
929+ }
930930);
931931// Set the signature to the field
932932field.setSignature(signature);
0 commit comments