Skip to content

Commit 220813f

Browse files
Merge pull request #73 from datalogics-rgailiunas/ts-cample
[APDFL-6431] Update Digital Signature sample to include RFC timestamps
2 parents bbf0318 + 60d7199 commit 220813f

21 files changed

+461
-19
lines changed

All/All_Datalogics_32Bit.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageExport", "..\Images\Im
161161
EndProject
162162
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageImport", "..\Images\ImageImport\ImageImport.vcxproj", "{C2FDB39D-49DA-4237-BC31-85284AAFE6BC}"
163163
EndProject
164-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignature", "..\Security\AddDigitalSignature\AddDigitalSignature.vcxproj", "{2455491E-6218-402A-9BB3-D09FA1F5C284}"
164+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignatureCMS", "..\Security\AddDigitalSignatureCMS\AddDigitalSignatureCMS.vcxproj", "{2455491E-6218-402A-9BB3-D09FA1F5C284}"
165+
EndProject
166+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignatureRFC3161", "..\Security\AddDigitalSignatureRFC3161\AddDigitalSignatureRFC3161.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
165167
EndProject
166168
Global
167169
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -485,6 +487,10 @@ Global
485487
{2455491E-6218-402A-9BB3-D09FA1F5C284}.Debug|Win32.Build.0 = Debug|Win32
486488
{2455491E-6218-402A-9BB3-D09FA1F5C284}.Release|Win32.ActiveCfg = Release|Win32
487489
{2455491E-6218-402A-9BB3-D09FA1F5C284}.Release|Win32.Build.0 = Release|Win32
490+
{1D787362-28C9-4460-9606-840F3B484350}.Debug|Win32.ActiveCfg = Debug|Win32
491+
{1D787362-28C9-4460-9606-840F3B484350}.Debug|Win32.Build.0 = Debug|Win32
492+
{1D787362-28C9-4460-9606-840F3B484350}.Release|Win32.ActiveCfg = Release|Win32
493+
{1D787362-28C9-4460-9606-840F3B484350}.Release|Win32.Build.0 = Release|Win32
488494
EndGlobalSection
489495
GlobalSection(SolutionProperties) = preSolution
490496
HideSolutionNode = FALSE

All/All_Datalogics_64Bit.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageExport", "..\Images\Im
161161
EndProject
162162
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageImport", "..\Images\ImageImport\ImageImport.vcxproj", "{C2FDB39D-49DA-4237-BC31-85284AAFE6BC}"
163163
EndProject
164-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignature", "..\Security\AddDigitalSignature\AddDigitalSignature.vcxproj", "{2455491E-6218-402A-9BB3-D09FA1F5C284}"
164+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignatureCMS", "..\Security\AddDigitalSignatureCMS\AddDigitalSignatureCMS.vcxproj", "{2455491E-6218-402A-9BB3-D09FA1F5C284}"
165+
EndProject
166+
Project("{1D787362-28C9-4460-9606-840F3B484350}") = "AddDigitalSignatureRFC3161", "..\Security\AddDigitalSignatureRFC3161\AddDigitalSignatureRFC3161.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
165167
EndProject
166168
Global
167169
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -485,6 +487,10 @@ Global
485487
{2455491E-6218-402A-9BB3-D09FA1F5C284}.Debug|x64.Build.0 = Debug|x64
486488
{2455491E-6218-402A-9BB3-D09FA1F5C284}.Release|x64.ActiveCfg = Release|x64
487489
{2455491E-6218-402A-9BB3-D09FA1F5C284}.Release|x64.Build.0 = Release|x64
490+
{1D787362-28C9-4460-9606-840F3B484350}.Debug|x64.ActiveCfg = Debug|x64
491+
{1D787362-28C9-4460-9606-840F3B484350}.Debug|x64.Build.0 = Debug|x64
492+
{1D787362-28C9-4460-9606-840F3B484350}.Release|x64.ActiveCfg = Release|x64
493+
{1D787362-28C9-4460-9606-840F3B484350}.Release|x64.Build.0 = Release|x64
488494
EndGlobalSection
489495
GlobalSection(SolutionProperties) = preSolution
490496
HideSolutionNode = FALSE

All/All_Datalogics_ARM64.sln

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageExport", "..\Images\Im
159159
EndProject
160160
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ImageImport", "..\Images\ImageImport\ImageImport.vcxproj", "{C2FDB39D-49DA-4237-BC31-85284AAFE6BC}"
161161
EndProject
162-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignature", "..\Security\AddDigitalSignature\AddDigitalSignature.vcxproj", "{2455491E-6218-402A-9BB3-D09FA1F5C284}"
162+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignatureCMS", "..\Security\AddDigitalSignatureCMS\AddDigitalSignatureCMS.vcxproj", "{2455491E-6218-402A-9BB3-D09FA1F5C284}"
163+
EndProject
164+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignatureRFC3161", "..\Security\AddDigitalSignatureRFC3161\AddDigitalSignatureRFC3161.vcxproj", "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
163165
EndProject
164166
Global
165167
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -479,6 +481,10 @@ Global
479481
{2455491E-6218-402A-9BB3-D09FA1F5C284}.Debug|ARM64.Build.0 = Debug|ARM64
480482
{2455491E-6218-402A-9BB3-D09FA1F5C284}.Release|ARM64.ActiveCfg = Release|ARM64
481483
{2455491E-6218-402A-9BB3-D09FA1F5C284}.Release|ARM64.Build.0 = Release|ARM64
484+
{1D787362-28C9-4460-9606-840F3B484350}.Debug|ARM64.ActiveCfg = Debug|ARM64
485+
{1D787362-28C9-4460-9606-840F3B484350}.Debug|ARM64.Build.0 = Debug|ARM64
486+
{1D787362-28C9-4460-9606-840F3B484350}.Release|ARM64.ActiveCfg = Release|ARM64
487+
{1D787362-28C9-4460-9606-840F3B484350}.Release|ARM64.Build.0 = Release|ARM64
482488
EndGlobalSection
483489
GlobalSection(SolutionProperties) = preSolution
484490
HideSolutionNode = FALSE

All/GNUmakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ SAMPLES = Annotations/CreateAnnotations \
7979
InformationExtraction/CountColorsInDoc \
8080
InformationExtraction/ExtractDocumentInfo \
8181
Printing/PostScriptInjection \
82-
Security/AddDigitalSignature \
82+
Security/AddDigitalSignatureCMS \
83+
Security/AddDigitalSignatureRFC3161 \
8384
Security/AddPassword \
8485
Security/AddRedaction \
8586
Security/AddRegexRedaction \

All/build_run_all.bat

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,8 @@ SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% ContentCreation\CreateDocument"
235235
SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% ContentCreation\CreateLayers"
236236
SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% ContentCreation\CreateTransparency"
237237
SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% Security\AESEncryption"
238-
SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% Security\AddDigitalSignature"
238+
SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% Security\AddDigitalSignatureCMS"
239+
SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% Security\AddDigitalSignatureRFC3161"
239240
SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% Security\AddPassword"
240241
SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% Security\AddRedaction"
241242
SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% Security\AddTriangularRedaction"
@@ -253,9 +254,9 @@ SET "DL_SAMPLE_LIST=%DL_SAMPLE_LIST% FileSystem\AlternateFileSystem"
253254

254255
REM *** The total number of DL samples. This must be accurate!
255256
IF NOT "%ARCH%"=="ARM64" (
256-
SET /A "NUM_DL_SAMPLES=72"
257-
) ELSE (
258257
SET /A "NUM_DL_SAMPLES=73"
258+
) ELSE (
259+
SET /A "NUM_DL_SAMPLES=74"
259260
)
260261

261262

All/build_run_all_mac.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ declare -a DL_SAMPLE_LIST=( \
111111
"InformationExtraction/ExtractDocumentInfo" \
112112
"Printing/PostScriptInjection" \
113113
"Security/AESEncryption" \
114-
"Security/AddDigitalSignature" \
114+
"Security/AddDigitalSignatureCMS" \
115+
"Security/AddDigitalSignatureRFC3161" \
115116
"Security/AddPassword" \
116117
"Security/AddRedaction" \
117118
"Security/EncryptDocument" \

All/run_all_DL_samples_mac.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -288,9 +288,14 @@ cd ../../Security/AESEncryption
288288
./AESEncryption-${stage}.app/Contents/MacOS/AESEncryption-${stage}
289289
echo ""
290290

291-
echo Running sample AddDigitalSignature
292-
cd ../../Security/AddDigitalSignature
293-
./AddDigitalSignature-${stage}.app/Contents/MacOS/AddDigitalSignature-${stage}
291+
echo Running sample AddDigitalSignatureCMS
292+
cd ../../Security/AddDigitalSignatureCMS
293+
./AddDigitalSignatureCMS-${stage}.app/Contents/MacOS/AddDigitalSignatureCMS-${stage}
294+
echo ""
295+
296+
echo Running sample AddDigitalSignatureRFC3161
297+
cd ../../Security/AddDigitalSignatureRFC3161
298+
./AddDigitalSignatureRFC3161-${stage}.app/Contents/MacOS/AddDigitalSignatureRFC3161-${stage}
294299
echo ""
295300

296301
echo Running sample AddPassword

Security/AddDigitalSignature/AddDigitalSignature.cpp renamed to Security/AddDigitalSignatureCMS/AddDigitalSignatureCMS.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
#define INPUT_LOC "../../../../Resources/Sample_Input/"
1919
#define DEF_INPUT "SixPages.pdf"
20-
#define DEF_OUTPUT "AddDigitalSignature-out.pdf"
20+
#define DEF_OUTPUT "AddDigitalSignatureCMS-out.pdf"
2121
#define DEF_LOGO_FILE "ducky_alpha.tif"
2222

2323
// DEF_CERT_FILE points to the signer certificate which may be binary(.der file format)
@@ -53,6 +53,10 @@ int main(int argc, char **argv) {
5353
// Setup Sign params
5454
PDSignDocSignParams const signParams = PDSignDocSignInitParams();
5555

56+
// Set the signature type to be used. The available types are defined in the SignatureType enum. Default CMS.
57+
// If ever unsure of the signature type applied, use PDSignDocGetDocSignType(signParams);
58+
PDSignDocSetDocSignType(signParams, CMS);
59+
5660
PDSignDocSetFieldID(signParams, CreateFieldWithQualifiedName);
5761

5862
// Set the size and location of the signature box (optional)

Security/AddDigitalSignature/AddDigitalSignature.vcxproj renamed to Security/AddDigitalSignatureCMS/AddDigitalSignatureCMS.vcxproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@
2929
<PropertyGroup Label="Globals">
3030
<ProjectGuid>{2455491e-6218-402a-9bb3-d09fa1f5c284}</ProjectGuid>
3131
<Keyword>Win32Proj</Keyword>
32-
<RootNamespace>AddDigitalSignature</RootNamespace>
33-
<ProjectName>AddDigitalSignature</ProjectName>
32+
<RootNamespace>AddDigitalSignatureCMS</RootNamespace>
33+
<ProjectName>AddDigitalSignatureCMS</ProjectName>
3434
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
3535
</PropertyGroup>
3636
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
@@ -235,7 +235,7 @@
235235
<ClCompile Include="..\..\_Common\InitializeLibrary.cpp" />
236236
<ClCompile Include="..\..\..\Include\Source\PDFLInitCommon.c" />
237237
<ClCompile Include="..\..\..\Include\Source\PDFLInitHFT.c" />
238-
<ClCompile Include="AddDigitalSignature.cpp" />
238+
<ClCompile Include="AddDigitalSignatureCMS.cpp" />
239239
</ItemGroup>
240240
<ItemGroup>
241241
<ClInclude Include="..\..\_Common\APDFLDoc.h" />

Security/AddDigitalSignature/AddDigitalSignature_32bit.sln renamed to Security/AddDigitalSignatureCMS/AddDigitalSignatureCMS_32bit.sln

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio Version 16
44
VisualStudioVersion = 16.0.35425.106
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignature", "AddDigitalSignature.vcxproj", "{2455491E-6218-402A-9BB3-D09FA1F5C284}"
6+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "AddDigitalSignatureCMS", "AddDigitalSignatureCMS.vcxproj", "{2455491E-6218-402A-9BB3-D09FA1F5C284}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution

0 commit comments

Comments
 (0)