mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-12 04:35:41 +03:00
cie-middleware-linux: 1.5.6 -> 1.5.9
(cherry picked from commit 165ad6efdc
)
This commit is contained in:
parent
60fc3b9b5e
commit
9f7e97bf0f
3 changed files with 75 additions and 419 deletions
138
pkgs/by-name/ci/cie-middleware-linux/deps.json
generated
138
pkgs/by-name/ci/cie-middleware-linux/deps.json
generated
|
@ -14,28 +14,28 @@
|
|||
"jar": "sha256-CV/R3HeIjAc/C+OaAYFW7lJnInmLCd6eKF7yE14W6sQ=",
|
||||
"pom": "sha256-NQkZQkMk4nUKPdwvobzmqQrIziklaYpgqbTR1uSSL/4="
|
||||
},
|
||||
"com/diffplug/durian#durian-swt.os/4.2.2": {
|
||||
"jar": "sha256-a1Mca0vlgaizLq2GHdwVwsk7IMZl+00z4DgUg8JERfQ=",
|
||||
"module": "sha256-rVlQLGknZu48M0vkliigDctNka4aSPJjLitxUStDXPk=",
|
||||
"pom": "sha256-GzxJFP1eLM4pZq1wdWY5ZBFFwdNCB3CTV4Py3yY2kIU="
|
||||
"com/diffplug/durian#durian-swt.os/4.3.0": {
|
||||
"jar": "sha256-geK2Oafkvm3JtyRXE88G9cq1HynbLha5tXZFyW/eKIQ=",
|
||||
"module": "sha256-IFNqlfL+sr9DBRKMaq7Lb9idxFeYqchfJgK4qAnXUNs=",
|
||||
"pom": "sha256-Q1z/VXiZht7arXF/aPuo1UgklHhWLc2EsirU1lZvRAs="
|
||||
},
|
||||
"com/diffplug/spotless#com.diffplug.spotless.gradle.plugin/6.25.0": {
|
||||
"pom": "sha256-9FyCsS+qzYWs1HTrppkyL6XeqIQIskfQ5L3pQSkIIjo="
|
||||
"com/diffplug/spotless#com.diffplug.spotless.gradle.plugin/7.0.2": {
|
||||
"pom": "sha256-7R3td6KWpv4hpQJ5ySbAe+FK98CMJDfTaFxw/Pa7oC0="
|
||||
},
|
||||
"com/diffplug/spotless#spotless-lib-extra/2.45.0": {
|
||||
"jar": "sha256-YCy7zTgo7pz7LjCn+bMDNcaScTB3FBTUzdKU0h/ly2c=",
|
||||
"module": "sha256-9pnkNfTlzgPbYJpHaO6wNj1uB8ZfvPrx/GKcTnbuf7A=",
|
||||
"pom": "sha256-5x2LkRDdSNLn9KVLi/uozlWpbmteu9T0OpJGZJz1b7A="
|
||||
"com/diffplug/spotless#spotless-lib-extra/3.0.2": {
|
||||
"jar": "sha256-sOd3RtYz1EXnhImsPQitLqGzU3xNBk5KvkbMQtYjA+s=",
|
||||
"module": "sha256-vSVeQkQbWRehU8U9z5fP08IEevN2zF3Yu1Z/aEAWtFk=",
|
||||
"pom": "sha256-IVesGayscKzQRQH8WbvJZNsZD1tx5O1e/s6o5c9o7Os="
|
||||
},
|
||||
"com/diffplug/spotless#spotless-lib/2.45.0": {
|
||||
"jar": "sha256-sllply4dmAKAyirlKRl+2bMWCq5ItQbPGTXwG9Exhmc=",
|
||||
"module": "sha256-+x+8+TUAczrHWcp99E8P9mVTEze0LaAS4on/CINNiQ8=",
|
||||
"pom": "sha256-WKd8IsQLIc8m29tCEwFu9HrM9bBwchfHkyqQ9D+PMNw="
|
||||
"com/diffplug/spotless#spotless-lib/3.0.2": {
|
||||
"jar": "sha256-P5p/38WwOsIIlINBcJEMFcTyuE7UzjZ3iYowetWJg3w=",
|
||||
"module": "sha256-E1WLrsCR6gDxYmXNNSOBePT+ejv61zXel214XUF/ss0=",
|
||||
"pom": "sha256-jxtFo4m6Jeel8DvZ8KS9BKp+dHXgku6C1VUJYrLPdV8="
|
||||
},
|
||||
"com/diffplug/spotless#spotless-plugin-gradle/6.25.0": {
|
||||
"jar": "sha256-9euQikxdpGKZ51Q/qtoEAtLEt31Yx7Qy1Lblk0mygKM=",
|
||||
"module": "sha256-RoHRe/PJIF2DeOynBcAAywzJjcx40DATy2iJjGvSx0Q=",
|
||||
"pom": "sha256-q1ZuPYS2w/rHqPySXy279TzZdZywOvPAfQ3EN9OXqNo="
|
||||
"com/diffplug/spotless#spotless-plugin-gradle/7.0.2": {
|
||||
"jar": "sha256-WaNMT4SkjUyNkp4viZBjaeZUduwEmaQ96Hw+QSeXfNU=",
|
||||
"module": "sha256-rxC8mydsNqlNcRh+kVhwJ1yyRVZTntzqGYpYL30Tsws=",
|
||||
"pom": "sha256-JyVoPfbvTNSIr+sgANqJIpQcqQ513D49uFIupxWKaMQ="
|
||||
},
|
||||
"com/googlecode/concurrent-trees#concurrent-trees/2.6.1": {
|
||||
"jar": "sha256-BONySYTipcv1VgbPo3KlvT08XSohUzpwBOPN5Tl2H6U=",
|
||||
|
@ -59,31 +59,31 @@
|
|||
"module": "sha256-akesUDZOZZhFlAH7hvm2z832N7mzowRbHMM8v0xAghg=",
|
||||
"pom": "sha256-rrO3CiTBA+0MVFQfNfXFEdJ85gyuN2pZbX1lNpf4zJU="
|
||||
},
|
||||
"commons-codec#commons-codec/1.16.0": {
|
||||
"jar": "sha256-VllfsgsLhbyR0NUD2tULt/G5r8Du1d/6bLslkpAASE0=",
|
||||
"pom": "sha256-bLWVeBnfOTlW/TEaOgw/XuwevEm6Wy0J8/ROYWf6PnQ="
|
||||
"commons-codec#commons-codec/1.17.0": {
|
||||
"jar": "sha256-9wDegKwnDQNE/ep0aCAdi5yAXlxkgzHDYZ8u4GfM/Fk=",
|
||||
"pom": "sha256-wBxM2l5Aj0HtHYPkoKFwz1OAG2M4q6SfD5BHhrwSFPw="
|
||||
},
|
||||
"dev/equo/ide#solstice/1.7.5": {
|
||||
"jar": "sha256-BuFLxDrMMx2ra16iAfxnNk7RI/mCyF+lEx8IF+1lrk8=",
|
||||
"module": "sha256-eYp7cGdyE27iijLt2GOx6fgWE6NJhAXXS+ilyb6/9U8=",
|
||||
"pom": "sha256-20U7urXn2opDE5sNzTuuZykzIfKcTZH1p5XZ/2xS3d8="
|
||||
"dev/equo/ide#solstice/1.8.1": {
|
||||
"jar": "sha256-bluizOgTvh1xzNwuzz5JJxsU5pG/u7GhFM86MOdzsQ0=",
|
||||
"module": "sha256-pnYDnqavCPJXtG4Hwr8VcaRqTUtbnMuGw/yY0H+v6hs=",
|
||||
"pom": "sha256-arSo7K4qu9NrkZ0Lm5+yTBdxSPE+U2TJegxu4Ro/xCY="
|
||||
},
|
||||
"org/apache#apache/29": {
|
||||
"pom": "sha256-PkkDcXSCC70N9jQgqXclWIY5iVTCoGKR+mH3J6w1s3c="
|
||||
"org/apache#apache/31": {
|
||||
"pom": "sha256-VV0MnqppwEKv+SSSe5OB6PgXQTbTVe6tRFIkRS5ikcw="
|
||||
},
|
||||
"org/apache/commons#commons-parent/58": {
|
||||
"pom": "sha256-LUsS4YiZBjq9fHUni1+pejcp2Ah4zuy2pA2UbpwNVZA="
|
||||
"org/apache/commons#commons-parent/69": {
|
||||
"pom": "sha256-1Q2pw5vcqCPWGNG0oDtz8ZZJf8uGFv0NpyfIYjWSqbs="
|
||||
},
|
||||
"org/eclipse/jgit#org.eclipse.jgit-parent/6.7.0.202309050840-r": {
|
||||
"pom": "sha256-u56FQW2Y0HMfx2f41w6EaAQWAdZnKuItsqx5n3qjkR8="
|
||||
"org/eclipse/jgit#org.eclipse.jgit-parent/6.10.0.202406032230-r": {
|
||||
"pom": "sha256-8tNTmgp5Iv15RwgsGQHSCQ2uB0mGsi2r2XO0OYzR6i4="
|
||||
},
|
||||
"org/eclipse/jgit#org.eclipse.jgit/6.7.0.202309050840-r": {
|
||||
"jar": "sha256-tWRHfQkiQaqrUMhKxd0aw3XAGCBE1+VlnTpgqQ4ugBo=",
|
||||
"pom": "sha256-BNB83b8ZjfpuRIuan7lA94HAEq2T2eqCBv4KTTplwZI="
|
||||
"org/eclipse/jgit#org.eclipse.jgit/6.10.0.202406032230-r": {
|
||||
"jar": "sha256-Q/kvOttoGl8wBrl56NNBwSqM/YAp8ofEK88KgDd1Za4=",
|
||||
"pom": "sha256-BVlUQr62ogYQi2c6qcZpLIPkHfGDF33GcROxzD9Sgd0="
|
||||
},
|
||||
"org/eclipse/platform#org.eclipse.osgi/3.18.300": {
|
||||
"jar": "sha256-urlD5Y7dFzCSOGctunpFrsni2svd24GKjPF3I+oT+iI=",
|
||||
"pom": "sha256-4nl2N1mZxUJ/y8//PzvCD77a+tiqRRArN59cL5fI/rQ="
|
||||
"org/eclipse/platform#org.eclipse.osgi/3.18.500": {
|
||||
"jar": "sha256-gLJ11YN5cjspHqZQJJzDgJyPELNPeKr5iBMs1tQ0q04=",
|
||||
"pom": "sha256-4o9b4Azk7Sx+SAnsrQW5UwfzWhflhWAHhri97juk2Wg="
|
||||
},
|
||||
"org/jetbrains#annotations/13.0": {
|
||||
"jar": "sha256-rOKhDcji1f00kl7KwD5JiLLA+FFlDJS4zvSbob0RFHg=",
|
||||
|
@ -114,9 +114,9 @@
|
|||
"jar": "sha256-VemJxRK4CQd5n4VDCfO8d4LFs9E5MkQtA3nVxHJxFQQ=",
|
||||
"pom": "sha256-fin79z/fceBnnT3ufmgP1XNGT6AWRKT1irgZ0sCI09I="
|
||||
},
|
||||
"org/junit#junit-bom/5.9.3": {
|
||||
"module": "sha256-tAH9JZAeWCpSSqU0PEs54ovFbiSWHBBpvytLv87ka5M=",
|
||||
"pom": "sha256-TQMpzZ5y8kIOXKFXJMv+b/puX9KIg2FRYnEZD9w0Ltc="
|
||||
"org/junit#junit-bom/5.10.2": {
|
||||
"module": "sha256-3iOxFLPkEZqP5usXvtWjhSgWaYus5nBxV51tkn67CAo=",
|
||||
"pom": "sha256-Fp3ZBKSw9lIM/+ZYzGIpK/6fPBSpifqSEgckzeQ6mWg="
|
||||
},
|
||||
"org/slf4j#slf4j-api/1.7.36": {
|
||||
"jar": "sha256-0+9XXj5JeWeNwBvx3M5RAhSTtNEft/G+itmCh3wWocA=",
|
||||
|
@ -137,31 +137,31 @@
|
|||
}
|
||||
},
|
||||
"https://repo.maven.apache.org/maven2": {
|
||||
"com/google/code/gson#gson-parent/2.11.0": {
|
||||
"pom": "sha256-issfO3Km8CaRasBzW62aqwKT1Sftt7NlMn3vE6k2e3o="
|
||||
"com/google/code/gson#gson-parent/2.12.1": {
|
||||
"pom": "sha256-yeewt+Mb574iaEl5wGgAHGUssRPE5u2JTjm2Q97gf8E="
|
||||
},
|
||||
"com/google/code/gson#gson/2.11.0": {
|
||||
"jar": "sha256-V5KNblpu3rKr03cKj5W6RNzkXzsjt6ncKzCcWBVSp4s=",
|
||||
"pom": "sha256-wOVHvqmYiI5uJcWIapDnYicryItSdTQ90sBd7Wyi42A="
|
||||
"com/google/code/gson#gson/2.12.1": {
|
||||
"jar": "sha256-6+4T1ft0d81/HMAQ4MNW34yoBwlxUkjal/eeNcy0++w=",
|
||||
"pom": "sha256-C1c17IX0UoLx4sdpd5gAQnsVCoFj9AUJOpKAtxyrGXg="
|
||||
},
|
||||
"com/google/errorprone#error_prone_annotations/2.27.0": {
|
||||
"jar": "sha256-JMkjNyxY410LnxagKJKbua7cd1IYZ8J08r0HNd9bofU=",
|
||||
"pom": "sha256-TKWjXWEjXhZUmsNG0eNFUc3w/ifoSqV+A8vrJV6k5do="
|
||||
"com/google/errorprone#error_prone_annotations/2.36.0": {
|
||||
"jar": "sha256-d0QOJwsLyaJJkDxaB2w2pyLEiGyk9CZ18pA6HFPtYaU=",
|
||||
"pom": "sha256-15z9N8hfdta3VMdQHuHchEe3smQsI4LXeCUhZr0zHpw="
|
||||
},
|
||||
"com/google/errorprone#error_prone_parent/2.27.0": {
|
||||
"pom": "sha256-+oGCnQSVWd9pJ/nJpv1rvQn4tQ5tRzaucsgwC2w9dlQ="
|
||||
"com/google/errorprone#error_prone_parent/2.36.0": {
|
||||
"pom": "sha256-Okz8imvtYetI6Wl5b8MeoNJwtj5nBZmUamGIOttwlNw="
|
||||
},
|
||||
"commons-io#commons-io/2.18.0": {
|
||||
"jar": "sha256-88oPjWPEDiOlbVQQHGDV7e4Ta0LYS/uFvHljCTEJz4s=",
|
||||
"pom": "sha256-Y9lpQetE35yQ0q2yrYw/aZwuBl5wcEXF2vcT/KUrz8o="
|
||||
},
|
||||
"commons-logging#commons-logging/1.3.3": {
|
||||
"jar": "sha256-WCj5bAnYhvmxoJk8eASyfPT87IU0UXFk9RN6yLZ+qbk=",
|
||||
"pom": "sha256-El1hQurD93REC6cCwF8o+eCYxS0QcSrhFJast3EGs7o="
|
||||
"commons-logging#commons-logging/1.3.4": {
|
||||
"jar": "sha256-vC3+MvHvBlCeagZRRMGt97Qg6r8RqH8wvRJ/j6ozIBY=",
|
||||
"pom": "sha256-1L2jSJKqzL9PrTP8MjqKqQfvnXmYRlnaJJRMCoa/CGU="
|
||||
},
|
||||
"net/java/dev/jna#jna/5.15.0": {
|
||||
"jar": "sha256-pWQVjSirUSf8apWAKO1UJ5/gmZZixGQltqOwmipSCU0=",
|
||||
"pom": "sha256-J2YC/zZ6TDkVXa7MHoy1T0eJ5dgN+Qo6i2YD8d61ngU="
|
||||
"net/java/dev/jna#jna/5.17.0": {
|
||||
"jar": "sha256-s6lAjnxR4I7w47/MCPRD9uwPYZG6jNfBjVPSsi5b28A=",
|
||||
"pom": "sha256-UBoP8F2EpK0Q9t4lvpT0k5i3CjG+jzoO2fTGtE++/uQ="
|
||||
},
|
||||
"org/apache#apache/32": {
|
||||
"pom": "sha256-z9hywOwn9Trmj0PbwP7N7YrddzB5pTr705DkB7Qs5y8="
|
||||
|
@ -169,26 +169,26 @@
|
|||
"org/apache#apache/33": {
|
||||
"pom": "sha256-14vYUkxfg4ChkKZSVoZimpXf5RLfIRETg6bYwJI6RBU="
|
||||
},
|
||||
"org/apache/commons#commons-parent/71": {
|
||||
"pom": "sha256-lbe+cPMWrkyiL2+90I3iGC6HzYdKZQ3nw9M4anR6gqM="
|
||||
"org/apache/commons#commons-parent/72": {
|
||||
"pom": "sha256-Q0Xev8dnsa6saKvdcvxn0YtSHUs5A3KhG2P/DFhrIyA="
|
||||
},
|
||||
"org/apache/commons#commons-parent/78": {
|
||||
"pom": "sha256-Ai0gLmVe3QTyoQ7L5FPZKXeSTTg4Ckyow1nxgXqAMg4="
|
||||
},
|
||||
"org/apache/pdfbox#fontbox/3.0.3": {
|
||||
"jar": "sha256-ZWkMPzmwShTRLBf0mYwVGGzod9Pi7CIscIV348wCgDA=",
|
||||
"pom": "sha256-sik+UDqncEMGEVD4hGg9f2FMz1Fjvi0PBSyinzx2d+I="
|
||||
"org/apache/pdfbox#fontbox/3.0.4": {
|
||||
"jar": "sha256-Le7GIy9dbTsxJ2WS0xaArpcir1fSTLD3bacOK6DpnhI=",
|
||||
"pom": "sha256-8MzDMOmyDYlXigqHArR6OZvNYojCOG10/6uPjjAoROg="
|
||||
},
|
||||
"org/apache/pdfbox#pdfbox-io/3.0.3": {
|
||||
"jar": "sha256-Ej6jGHtJfFTmYdUMPIZ0eb93Zo/0UOUHEMZY8rtGh7o=",
|
||||
"pom": "sha256-EXAbuMWnNaSzFA9zroM6KBzqCeO8P583kbmpenRekNQ="
|
||||
"org/apache/pdfbox#pdfbox-io/3.0.4": {
|
||||
"jar": "sha256-ep1HRvLhOh4i9O/kf7r5mXY8rqQXSFNa+ToB7txQ9VQ=",
|
||||
"pom": "sha256-YLURdX737TBIv4LH2ClvcdC8RwAgEYQzqzs+OEC/jqU="
|
||||
},
|
||||
"org/apache/pdfbox#pdfbox-parent/3.0.3": {
|
||||
"pom": "sha256-yGXhzv8Jq1Kwh+cmDE8V025bW4vk/+IERvqkCiygvcw="
|
||||
"org/apache/pdfbox#pdfbox-parent/3.0.4": {
|
||||
"pom": "sha256-w5j++zUez/mTEYCNftU0bnHzVrETS9c6JQTLgXB9tFE="
|
||||
},
|
||||
"org/apache/pdfbox#pdfbox/3.0.3": {
|
||||
"jar": "sha256-W+ONLsgWkbBdU163IN5NxWbF0H5aBHMfoAZo0VOotKY=",
|
||||
"pom": "sha256-vgiV9rLCDzEdYjXJam/SqsECsxkE0/TDnqUll3WwcAg="
|
||||
"org/apache/pdfbox#pdfbox/3.0.4": {
|
||||
"jar": "sha256-CaD/J9b4Sh3EAGDLCgHezyrU75HDa8kbmDbCVL6KrkU=",
|
||||
"pom": "sha256-098DLfK90jT+NwMO+sNXa6Yj/Jf1ERNUxMUq13dfkOQ="
|
||||
},
|
||||
"org/junit#junit-bom/5.11.0-M2": {
|
||||
"module": "sha256-hkd6vPSQ1soFmqmXPLEI0ipQb0nRpVabsyzGy/Q8LM4=",
|
||||
|
|
|
@ -21,13 +21,13 @@
|
|||
|
||||
let
|
||||
pname = "cie-middleware-linux";
|
||||
version = "1.5.6";
|
||||
version = "1.5.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "M0rf30";
|
||||
repo = "cie-middleware-linux";
|
||||
rev = version;
|
||||
sha256 = "sha256-2P/1hQTmeQ6qE7RgAeLOZTszcLcIpa2XX1S2ahXRHcc=";
|
||||
hash = "sha256-2UMKxanF35oBNBtIqfU46QUYJwXiTU1xCrCMqzqetgI=";
|
||||
};
|
||||
|
||||
gradle = gradle_8;
|
||||
|
@ -61,8 +61,6 @@ stdenv.mkDerivation {
|
|||
libxml2
|
||||
];
|
||||
|
||||
patches = [ ./use-system-podofo.patch ];
|
||||
|
||||
postPatch = ''
|
||||
# substitute the cieid command with this $out/bin/cieid
|
||||
substituteInPlace libs/pkcs11/src/CSP/AbilitaCIE.cpp \
|
||||
|
@ -114,6 +112,7 @@ stdenv.mkDerivation {
|
|||
popd
|
||||
|
||||
# Install the Java application
|
||||
ls cie-java/build/libs/CIEID-standalone.jar
|
||||
install -Dm755 cie-java/build/libs/CIEID-standalone.jar \
|
||||
"$out/share/cieid/cieid.jar"
|
||||
|
||||
|
@ -123,11 +122,11 @@ stdenv.mkDerivation {
|
|||
--add-flags "-Djna.library.path='$out/lib:${libraries}'" \
|
||||
--add-flags '-Dawt.useSystemAAFontSettings=on' \
|
||||
--add-flags "-cp $out/share/cieid/cieid.jar" \
|
||||
--add-flags "it.ipzs.cieid.MainApplication"
|
||||
--add-flags "app.m0rf30.cieid.MainApplication"
|
||||
|
||||
# Install other files
|
||||
install -Dm644 data/cieid.desktop "$out/share/applications/cieid.desktop"
|
||||
install -Dm755 data/logo.png "$out/share/pixmaps/cieid.png"
|
||||
install -Dm644 data/app.m0rf30.cieid.desktop -t "$out/share/applications"
|
||||
install -Dm755 data/app.m0rf30.cieid.svg -t "$out/share/pixmaps"
|
||||
install -Dm644 LICENSE "$out/share/licenses/cieid/LICENSE"
|
||||
'';
|
||||
|
||||
|
|
|
@ -1,343 +0,0 @@
|
|||
commit c9ac4243a6def08790bbf5552bb31894169596ca
|
||||
Author: rnhmjoj <rnhmjoj@inventati.org>
|
||||
Date: Wed Apr 3 12:54:58 2024 +0200
|
||||
|
||||
use system podofo
|
||||
|
||||
diff --git a/libs/meson.build b/libs/meson.build
|
||||
index 3ee31c1..5022ba8 100644
|
||||
--- a/libs/meson.build
|
||||
+++ b/libs/meson.build
|
||||
@@ -16,21 +16,15 @@ curl_dep = dependency('libcurl')
|
||||
fontconfig_dep = dependency('fontconfig')
|
||||
freetype_dep = dependency('freetype2')
|
||||
png_dep = dependency('libpng')
|
||||
-podofo_dep = cpp.find_library('libpodofo', dirs: libdir)
|
||||
+podofo_dep = dependency('libpodofo')
|
||||
libxml2_dep = dependency('libxml-2.0', required: false)
|
||||
xml2_dep = dependency('xml2', required: false)
|
||||
zlib_dep = dependency('zlib')
|
||||
|
||||
inc_so = include_directories('pkcs11/src/.', 'shared/src/')
|
||||
|
||||
-inc_a = include_directories(
|
||||
- 'sign-sdk/include',
|
||||
- 'sign-sdk/include/podofo',
|
||||
- 'sign-sdk/include/podofo/include',
|
||||
- 'sign-sdk/include/podofo/include/podofo',
|
||||
- 'sign-sdk/src',
|
||||
- 'shared/src/',
|
||||
-)
|
||||
+inc_a = include_directories('sign-sdk/include', 'sign-sdk/src', 'shared/src/')
|
||||
+
|
||||
cie_pkcs11_sources = [
|
||||
'shared/src/Util/log.cpp',
|
||||
'shared/src/Util/funccallinfo.cpp',
|
||||
diff --git a/libs/sign-sdk/include/PdfSignatureGenerator.h b/libs/sign-sdk/include/PdfSignatureGenerator.h
|
||||
index 93ab445..65d438f 100644
|
||||
--- a/libs/sign-sdk/include/PdfSignatureGenerator.h
|
||||
+++ b/libs/sign-sdk/include/PdfSignatureGenerator.h
|
||||
@@ -10,9 +10,7 @@
|
||||
#ifndef _PDFSIGNATUREGENERATOR_H_
|
||||
#define _PDFSIGNATUREGENERATOR_H_
|
||||
#include "Util/UUCByteArray.h"
|
||||
-#include "podofo/doc/PdfSignOutputDevice.h"
|
||||
-#include "podofo/doc/PdfSignatureField.h"
|
||||
-#include "podofo/podofo.h"
|
||||
+#include <podofo/podofo.h>
|
||||
|
||||
using namespace PoDoFo;
|
||||
using namespace std;
|
||||
@@ -60,7 +58,11 @@ class PdfSignatureGenerator {
|
||||
const double getHeight(int pageIndex);
|
||||
|
||||
private:
|
||||
- PdfMemDocument* m_pPdfDocument;
|
||||
+ PdfDocument* m_pPdfDocument;
|
||||
+
|
||||
+ PdfMemDocument* m_pPdfMemDocument;
|
||||
+
|
||||
+ PdfWriter* m_pPdfWriter;
|
||||
|
||||
PdfSignatureField* m_pSignatureField;
|
||||
|
||||
diff --git a/libs/sign-sdk/src/PdfSignatureGenerator.cpp b/libs/sign-sdk/src/PdfSignatureGenerator.cpp
|
||||
index 44ef54a..e8b8c8e 100644
|
||||
--- a/libs/sign-sdk/src/PdfSignatureGenerator.cpp
|
||||
+++ b/libs/sign-sdk/src/PdfSignatureGenerator.cpp
|
||||
@@ -27,7 +27,7 @@ int GetNumberOfSignatures(PdfMemDocument* pPdfDocument);
|
||||
USE_LOG;
|
||||
|
||||
PdfSignatureGenerator::PdfSignatureGenerator()
|
||||
- : m_pPdfDocument(NULL),
|
||||
+ : m_pPdfMemDocument(NULL),
|
||||
m_pSignatureField(NULL),
|
||||
m_pSignOutputDevice(NULL),
|
||||
m_pFinalOutDevice(NULL),
|
||||
@@ -37,7 +37,7 @@ PdfSignatureGenerator::PdfSignatureGenerator()
|
||||
}
|
||||
|
||||
PdfSignatureGenerator::~PdfSignatureGenerator() {
|
||||
- if (m_pPdfDocument) delete m_pPdfDocument;
|
||||
+ if (m_pPdfMemDocument) delete m_pPdfMemDocument;
|
||||
|
||||
if (m_pSignatureField) delete m_pSignatureField;
|
||||
|
||||
@@ -51,21 +51,21 @@ PdfSignatureGenerator::~PdfSignatureGenerator() {
|
||||
}
|
||||
|
||||
int PdfSignatureGenerator::Load(const char* pdf, int len) {
|
||||
- if (m_pPdfDocument) delete m_pPdfDocument;
|
||||
+ if (m_pPdfMemDocument) delete m_pPdfMemDocument;
|
||||
|
||||
try {
|
||||
printf("PDF LENGTH");
|
||||
printf("%i", len);
|
||||
printf("STOP");
|
||||
|
||||
- m_pPdfDocument = new PdfMemDocument();
|
||||
- m_pPdfDocument->Load(pdf, len);
|
||||
- printf("OK m_pPdfDocument");
|
||||
- int nSigns = PDFVerifier::GetNumberOfSignatures(m_pPdfDocument);
|
||||
+ m_pPdfMemDocument = new PdfMemDocument();
|
||||
+ m_pPdfMemDocument->Load(pdf);
|
||||
+ printf("OK m_pPdfMemDocument");
|
||||
+ int nSigns = PDFVerifier::GetNumberOfSignatures(m_pPdfMemDocument);
|
||||
printf("OK nSigns: %d", nSigns);
|
||||
|
||||
if (nSigns > 0) {
|
||||
- m_pPdfDocument->SetIncrementalUpdates(true);
|
||||
+ m_pPdfWriter->PdfWriter::SetIncrementalUpdate(true);
|
||||
}
|
||||
m_actualLen = len;
|
||||
|
||||
@@ -82,14 +82,8 @@ void PdfSignatureGenerator::AddFont(const char* szFontName,
|
||||
// printf(szFontName);
|
||||
// printf(szFontPath);
|
||||
|
||||
- m_pPdfDocument->CreateFont(
|
||||
- szFontName, false, false,
|
||||
- PdfEncodingFactory::GlobalWinAnsiEncodingInstance(),
|
||||
- PdfFontCache::eFontCreationFlags_AutoSelectBase14, true, szFontPath);
|
||||
- m_pPdfDocument->CreateFont(
|
||||
- szFontName, true, false,
|
||||
- PdfEncodingFactory::GlobalWinAnsiEncodingInstance(),
|
||||
- PdfFontCache::eFontCreationFlags_AutoSelectBase14, true, szFontPath);
|
||||
+ m_pPdfDocument->PoDoFo::PdfDocument::CreateFont( szFontName, false, PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), PdfFontCache::eFontCreationFlags_AutoSelectBase14, true);
|
||||
+ m_pPdfDocument->PoDoFo::PdfDocument::CreateFont( szFontName, true, PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), PdfFontCache::eFontCreationFlags_AutoSelectBase14, true);
|
||||
}
|
||||
|
||||
void PdfSignatureGenerator::InitSignature(
|
||||
@@ -130,7 +124,7 @@ void PdfSignatureGenerator::InitSignature(
|
||||
|
||||
if (m_pSignatureField) delete m_pSignatureField;
|
||||
|
||||
- PdfPage* pPage = m_pPdfDocument->GetPage(pageIndex);
|
||||
+ PdfPage* pPage = m_pPdfMemDocument->GetPage(pageIndex);
|
||||
PdfRect cropBox = pPage->GetCropBox();
|
||||
|
||||
float left0 = left * cropBox.GetWidth();
|
||||
@@ -145,15 +139,14 @@ void PdfSignatureGenerator::InitSignature(
|
||||
|
||||
LOG_DBG((0, "InitSignature", "PdfSignatureField"));
|
||||
|
||||
- m_pSignatureField = new PdfSignatureField(
|
||||
- pPage, rect, m_pPdfDocument, PdfString(szFieldName), szSubFilter);
|
||||
+ m_pSignatureField = new PdfSignatureField(pPage, rect, m_pPdfMemDocument);
|
||||
|
||||
LOG_DBG((0, "InitSignature", "PdfSignatureField OK"));
|
||||
|
||||
if (szReason && szReason[0]) {
|
||||
PdfString reason(szReason);
|
||||
PdfString reasonLabel(szReasonLabel);
|
||||
- m_pSignatureField->SetSignatureReason(reasonLabel, reason);
|
||||
+ m_pSignatureField->SetSignatureReason(reason);
|
||||
}
|
||||
|
||||
LOG_DBG((0, "InitSignature", "szReason OK"));
|
||||
@@ -161,7 +154,7 @@ void PdfSignatureGenerator::InitSignature(
|
||||
if (szLocation && szLocation[0]) {
|
||||
PdfString location(szLocation);
|
||||
PdfString locationLabel(szLocationLabel);
|
||||
- m_pSignatureField->SetSignatureLocation(locationLabel, location);
|
||||
+ m_pSignatureField->SetSignatureLocation(location);
|
||||
}
|
||||
|
||||
LOG_DBG((0, "InitSignature", "szLocation OK"));
|
||||
@@ -171,54 +164,42 @@ void PdfSignatureGenerator::InitSignature(
|
||||
|
||||
LOG_DBG((0, "InitSignature", "Date OK"));
|
||||
|
||||
- if (szName && szName[0]) {
|
||||
- PdfString name(szName);
|
||||
- PdfString nameLabel(szNameLabel);
|
||||
- m_pSignatureField->SetSignatureName(nameLabel, name);
|
||||
- }
|
||||
-
|
||||
- LOG_DBG((0, "InitSignature", "szName OK"));
|
||||
-
|
||||
- m_pSignatureField->SetSignatureSize(SIGNATURE_SIZE);
|
||||
+ m_pSignOutputDevice->PdfSignOutputDevice::SetSignatureSize(SIGNATURE_SIZE);
|
||||
|
||||
LOG_DBG((0, "InitSignature", "SIGNATURE_SIZE OK"));
|
||||
|
||||
- // if((szImagePath && szImagePath[0]) || (szDescription && szDescription[0]))
|
||||
- if (width * height > 0) {
|
||||
- try {
|
||||
- // m_pSignatureField->SetFontSize(5);
|
||||
- m_pSignatureField->SetAppearance(szImagePath, szDescription);
|
||||
- LOG_DBG((0, "InitSignature", "SetAppearance OK"));
|
||||
- } catch (PdfError& error) {
|
||||
- LOG_ERR((0, "InitSignature", "SetAppearance error: %s, %s",
|
||||
- PdfError::ErrorMessage(error.GetError()), error.what()));
|
||||
- } catch (PdfError* perror) {
|
||||
- LOG_ERR((0, "InitSignature", "SetAppearance error2: %s, %s",
|
||||
- PdfError::ErrorMessage(perror->GetError()), perror->what()));
|
||||
- } catch (std::exception& ex) {
|
||||
- LOG_ERR(
|
||||
- (0, "InitSignature", "SetAppearance std exception, %s", ex.what()));
|
||||
- } catch (std::exception* pex) {
|
||||
- LOG_ERR((0, "InitSignature", "SetAppearance std exception2, %s",
|
||||
- pex->what()));
|
||||
- } catch (...) {
|
||||
- LOG_ERR((0, "InitSignature", "SetAppearance unknown error"));
|
||||
- }
|
||||
- }
|
||||
+ // if (width * height > 0) {
|
||||
+ // try {
|
||||
+ // m_pSignatureField->SetAppearance(szImagePath, szDescription);
|
||||
+ // LOG_DBG((0, "InitSignature", "SetAppearance OK"));
|
||||
+ // } catch (PdfError& error) {
|
||||
+ // LOG_ERR((0, "InitSignature", "SetAppearance error: %s, %s",
|
||||
+ // PdfError::ErrorMessage(error.GetError()), error.what()));
|
||||
+ // } catch (PdfError* perror) {
|
||||
+ // LOG_ERR((0, "InitSignature", "SetAppearance error2: %s, %s",
|
||||
+ // PdfError::ErrorMessage(perror->GetError()), perror->what()));
|
||||
+ // } catch (std::exception& ex) {
|
||||
+ // LOG_ERR(
|
||||
+ // (0, "InitSignature", "SetAppearance std exception, %s",
|
||||
+ // ex.what()));
|
||||
+ // } catch (std::exception* pex) {
|
||||
+ // LOG_ERR((0, "InitSignature", "SetAppearance std exception2, %s",
|
||||
+ // pex->what()));
|
||||
+ // } catch (...) {
|
||||
+ // LOG_ERR((0, "InitSignature", "SetAppearance unknown error"));
|
||||
+ // }
|
||||
+ // }
|
||||
|
||||
- if (szGraphometricData && szGraphometricData[0])
|
||||
- m_pSignatureField->SetGraphometricData(
|
||||
- PdfString("Aruba_Sign_Biometric_Data"), PdfString(szGraphometricData),
|
||||
- PdfString(szVersion));
|
||||
+ // if (szGraphometricData && szGraphometricData[0])
|
||||
+ // m_pSignatureField->SetGraphometricData(
|
||||
+ // PdfString("Aruba_Sign_Biometric_Data"),
|
||||
+ // PdfString(szGraphometricData), PdfString(szVersion));
|
||||
|
||||
- LOG_DBG((0, "InitSignature", "szGraphometricData OK"));
|
||||
+ // LOG_DBG((0, "InitSignature", "szGraphometricData OK"));
|
||||
|
||||
LOG_DBG((0, "InitSignature", "m_actualLen %d", m_actualLen));
|
||||
// crea il nuovo doc con il campo di firma
|
||||
- int fulllen = m_actualLen * 2 + SIGNATURE_SIZE * 2 +
|
||||
- (szGraphometricData
|
||||
- ? (strlen(szGraphometricData) + strlen(szVersion) + 100)
|
||||
- : 0);
|
||||
+ int fulllen = m_actualLen * 2 + SIGNATURE_SIZE * 2;
|
||||
|
||||
int mainDoclen = 0;
|
||||
m_pMainDocbuffer = NULL;
|
||||
@@ -227,7 +208,7 @@ void PdfSignatureGenerator::InitSignature(
|
||||
LOG_DBG((0, "InitSignature", "fulllen %d", fulllen));
|
||||
m_pMainDocbuffer = new char[fulllen];
|
||||
PdfOutputDevice pdfOutDevice(m_pMainDocbuffer, fulllen);
|
||||
- m_pPdfDocument->Write(&pdfOutDevice);
|
||||
+ m_pPdfMemDocument->Write(&pdfOutDevice);
|
||||
mainDoclen = pdfOutDevice.GetLength();
|
||||
} catch (::PoDoFo::PdfError err) {
|
||||
if (m_pMainDocbuffer) {
|
||||
@@ -301,32 +282,32 @@ void PdfSignatureGenerator::GetSignedPdf(UUCByteArray& signedPdf) {
|
||||
}
|
||||
|
||||
const double PdfSignatureGenerator::getWidth(int pageIndex) {
|
||||
- if (m_pPdfDocument) {
|
||||
- PdfPage* pPage = m_pPdfDocument->GetPage(pageIndex);
|
||||
+ if (m_pPdfMemDocument) {
|
||||
+ PdfPage* pPage = m_pPdfMemDocument->GetPage(pageIndex);
|
||||
return pPage->GetPageSize().GetWidth();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const double PdfSignatureGenerator::getHeight(int pageIndex) {
|
||||
- if (m_pPdfDocument) {
|
||||
- PdfPage* pPage = m_pPdfDocument->GetPage(pageIndex);
|
||||
+ if (m_pPdfMemDocument) {
|
||||
+ PdfPage* pPage = m_pPdfMemDocument->GetPage(pageIndex);
|
||||
return pPage->GetPageSize().GetHeight();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const double PdfSignatureGenerator::lastSignatureY(int left, int bottom) {
|
||||
- if (!m_pPdfDocument) return -1;
|
||||
+ if (!m_pPdfMemDocument) return -1;
|
||||
/// Find the document catalog dictionary
|
||||
- const PdfObject* const trailer = m_pPdfDocument->GetTrailer();
|
||||
+ const PdfObject* const trailer = m_pPdfMemDocument->GetTrailer();
|
||||
if (!trailer->IsDictionary()) return -1;
|
||||
const PdfObject* const catalogRef =
|
||||
trailer->GetDictionary().GetKey(PdfName("Root"));
|
||||
if (catalogRef == 0 || !catalogRef->IsReference())
|
||||
return -2; // throw std::invalid_argument("Invalid /Root entry");
|
||||
const PdfObject* const catalog =
|
||||
- m_pPdfDocument->GetObjects().GetObject(catalogRef->GetReference());
|
||||
+ m_pPdfMemDocument->GetObjects().GetObject(catalogRef->GetReference());
|
||||
if (catalog == 0 || !catalog->IsDictionary())
|
||||
return -3; // throw std::invalid_argument("Invalid or non-dictionary
|
||||
// referenced by /Root entry");
|
||||
@@ -336,8 +317,8 @@ const double PdfSignatureGenerator::lastSignatureY(int left, int bottom) {
|
||||
catalog->GetDictionary().GetKey(PdfName("AcroForm"));
|
||||
if (acroFormValue == 0) return bottom;
|
||||
if (acroFormValue->IsReference())
|
||||
- acroFormValue =
|
||||
- m_pPdfDocument->GetObjects().GetObject(acroFormValue->GetReference());
|
||||
+ acroFormValue = m_pPdfMemDocument->GetObjects().GetObject(
|
||||
+ acroFormValue->GetReference());
|
||||
|
||||
if (!acroFormValue->IsDictionary()) return bottom;
|
||||
|
||||
@@ -346,8 +327,8 @@ const double PdfSignatureGenerator::lastSignatureY(int left, int bottom) {
|
||||
if (fieldsValue == 0) return bottom;
|
||||
|
||||
if (fieldsValue->IsReference())
|
||||
- fieldsValue =
|
||||
- m_pPdfDocument->GetObjects().GetObject(acroFormValue->GetReference());
|
||||
+ fieldsValue = m_pPdfMemDocument->GetObjects().GetObject(
|
||||
+ acroFormValue->GetReference());
|
||||
|
||||
if (!fieldsValue->IsArray()) return bottom;
|
||||
|
||||
@@ -360,8 +341,8 @@ const double PdfSignatureGenerator::lastSignatureY(int left, int bottom) {
|
||||
|
||||
for (unsigned int i = 0; i < array.size(); i++) {
|
||||
const PdfObject* pObj =
|
||||
- m_pPdfDocument->GetObjects().GetObject(array[i].GetReference());
|
||||
- if (IsSignatureField(m_pPdfDocument, pObj)) {
|
||||
+ m_pPdfMemDocument->GetObjects().GetObject(array[i].GetReference());
|
||||
+ if (IsSignatureField(m_pPdfMemDocument, pObj)) {
|
||||
const PdfObject* const keyRect =
|
||||
pObj->GetDictionary().GetKey(PdfName("Rect"));
|
||||
if (keyRect == 0) {
|
||||
diff --git a/libs/sign-sdk/src/disigonsdk.cpp b/libs/sign-sdk/src/disigonsdk.cpp
|
||||
index 250c93f..84e1b0b 100644
|
||||
--- a/libs/sign-sdk/src/disigonsdk.cpp
|
||||
+++ b/libs/sign-sdk/src/disigonsdk.cpp
|
||||
@@ -5,6 +5,7 @@
|
||||
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/xmlmemory.h>
|
||||
+#include <podofo/podofo.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue