├── test ├── data │ ├── test1.txt │ ├── öäüõ.txt │ ├── 0123456789~#%&()=`@{[]}'.txt │ ├── test.asice │ ├── test.asics │ ├── test2.bin │ ├── tsl.asice │ ├── signer1.p12 │ ├── signer2.p12 │ ├── signer3.p12 │ ├── signerEC.p12 │ ├── test-meta.asics │ ├── test-tera.asics │ ├── test-invalid.asics │ ├── test-invalidts.asics │ ├── test-tera-empty.asics │ ├── comma.crt │ ├── unicode.crt │ ├── digidocpp.conf │ ├── test.crt │ ├── xml-bomb-cont.xml │ ├── inter.crt │ ├── xml-bomb-attr.xml │ ├── openssl.conf │ ├── TSL.crt │ ├── 47101010033.cer │ ├── README.md │ └── gencerts.sh ├── TSLTests.cpp └── CMakeLists.txt ├── debian ├── source │ └── format ├── libdigidocpp-common.install ├── libdigidocpp-doc.install ├── libdigidocpp-java.triggers ├── libdigidocpp-tools.install ├── libdigidocpp1.install ├── libdigidocpp-csharp.triggers ├── libdigidocpp-python.install ├── libdigidocpp-csharp.install ├── libdigidocpp-java.install ├── libdigidocpp-dev.install ├── rules ├── changelog ├── libdigidocpp-java.lintian-overrides ├── libdigidocpp-csharp.lintian-overrides ├── copyright └── control ├── .gitattributes ├── examples ├── DigiDocCSharp │ ├── digidoc │ │ └── .gitignore │ ├── DigiDocCSharp.csproj │ ├── DigiDocCSharp.sln │ ├── LICENSE.BSD │ └── README.md ├── java │ ├── settings.gradle │ ├── .gitignore │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── README.md │ ├── build.gradle │ └── gradlew.bat ├── ios │ ├── libdigidocpp │ │ ├── test.bdoc │ │ ├── Images.xcassets │ │ │ └── AppIcon.appiconset │ │ │ │ ├── Icon-App-iPad.png │ │ │ │ ├── Icon-App@2x.png │ │ │ │ ├── Icon-App@3x.png │ │ │ │ ├── Icon-AppStore.png │ │ │ │ ├── Icon-Settings.png │ │ │ │ ├── Icon-App-iPad-Pro.png │ │ │ │ ├── Icon-App-iPad@2x.png │ │ │ │ ├── Icon-Settings@2x.png │ │ │ │ ├── Icon-Settings@3x.png │ │ │ │ └── Contents.json │ │ ├── main.mm │ │ ├── libdigidocpp.entitlements │ │ ├── AppDelegate.h │ │ ├── Info.plist │ │ └── AppDelegate.mm │ ├── libdigidocpp.xcodeproj │ │ └── project.xcworkspace │ │ │ └── contents.xcworkspacedata │ └── README.md ├── android │ ├── app │ │ ├── src │ │ │ └── main │ │ │ │ ├── res │ │ │ │ ├── raw │ │ │ │ │ └── test.bdoc │ │ │ │ ├── drawable-hdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-mdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-xhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── drawable-xxhdpi │ │ │ │ │ └── ic_launcher.png │ │ │ │ ├── values │ │ │ │ │ ├── strings.xml │ │ │ │ │ └── styles.xml │ │ │ │ └── layout │ │ │ │ │ └── activity_main.xml │ │ │ │ └── AndroidManifest.xml │ │ └── build.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── README.md │ ├── settings.gradle │ ├── build.gradle │ ├── gradle.properties │ └── gradlew.bat ├── python │ └── README.md ├── CMakeLists.txt ├── README.md └── pkcs11sign.cpp ├── ID.ico ├── banner.bmp ├── dlgbmp.bmp ├── etc ├── Doxyfile.css ├── schema │ ├── conf.xsd │ ├── en_31916201v010101.xsd.orig │ ├── en_31916201v010101.xsd │ ├── OpenDocument-v1.2-csd06-dsig-schema.rng │ ├── XAdES01903v141-201601.xsd │ ├── OpenDocument_dsig.xsd │ └── XAdES01903v141-201601.xsd.orig ├── digidocpp.conf.cmake ├── tl-mp1.crt ├── tl-mp4.crt ├── tl-mp7.crt ├── tl-mp5.crt ├── tl-mp3.crt ├── tl-mp6.crt └── tl-mp2.crt ├── doc └── sample_files.zip ├── AUTHORS ├── src ├── minizip │ ├── MiniZip64_Changes.txt │ ├── iowin32.h │ └── MiniZip64_info.txt ├── libdigidocpp.pc.cmake ├── setup.py.cmake ├── digidoc-tool.manifest ├── libdigidocpp.rc ├── SignatureCAdES_p.h ├── crypto │ ├── X509Crypto.h │ ├── PKCS12Signer.h │ ├── WinSigner.h │ ├── PKCS11Signer.h │ ├── TS.h │ ├── OCSP.h │ ├── X509CertStore.h │ ├── Signer.h │ ├── OpenSSLHelpers.h │ ├── Connect.h │ └── TSL.h ├── util │ ├── DateTime.h │ ├── DateTime.cpp │ ├── algorithm.h │ ├── log.h │ ├── ZipSerialize.h │ ├── memory.h │ └── File.h ├── SignatureXAdES_LTA.h ├── SignatureCAdES_T.h ├── DataFile.h ├── SignatureCAdES_B.h ├── SignatureXAdES_T.h ├── SignatureXAdES_LT.h ├── DataFile_p.h ├── ASiC_S.h ├── PDF.h ├── SignatureTST.h ├── Exports.h ├── ASiC_E.h ├── Container.h ├── SignatureCAdES_T.cpp ├── ASiContainer.h └── Exception.h ├── vcpkg-ports ├── libxml2 │ ├── usage │ ├── vcpkg-cmake-wrapper.cmake │ ├── cxx-for-icu.diff │ ├── disable-xml2-config.diff │ ├── fix_ios_compilation.patch │ ├── fix_cmakelist.patch │ ├── vcpkg.json │ └── portfile.cmake └── xmlsec │ ├── unofficial-xmlsec-config.cmake │ ├── xmlsec-config.cmake │ ├── usage │ ├── pkgconfig_fixes.patch │ ├── vcpkg.json │ └── portfile.cmake ├── vcpkg-triplets ├── x64-android.cmake ├── arm64-android.cmake └── arm-neon-android.cmake ├── cmake └── modules │ └── FindPKCS11.cmake └── vcpkg.json /test/data/test1.txt: -------------------------------------------------------------------------------- 1 | 1234 2 | -------------------------------------------------------------------------------- /test/data/öäüõ.txt: -------------------------------------------------------------------------------- 1 | 123 2 | -------------------------------------------------------------------------------- /debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | vcpkg-ports/**/* -text 2 | -------------------------------------------------------------------------------- /test/data/0123456789~#%&()=`@{[]}'.txt: -------------------------------------------------------------------------------- 1 | 123 2 | -------------------------------------------------------------------------------- /debian/libdigidocpp-common.install: -------------------------------------------------------------------------------- 1 | debian/tmp/etc 2 | -------------------------------------------------------------------------------- /debian/libdigidocpp-doc.install: -------------------------------------------------------------------------------- 1 | usr/share/doc 2 | -------------------------------------------------------------------------------- /examples/DigiDocCSharp/digidoc/.gitignore: -------------------------------------------------------------------------------- 1 | *.cs 2 | -------------------------------------------------------------------------------- /debian/libdigidocpp-java.triggers: -------------------------------------------------------------------------------- 1 | activate-noawait ldconfig 2 | -------------------------------------------------------------------------------- /debian/libdigidocpp-tools.install: -------------------------------------------------------------------------------- 1 | usr/bin 2 | usr/share/man 3 | -------------------------------------------------------------------------------- /debian/libdigidocpp1.install: -------------------------------------------------------------------------------- 1 | usr/lib/*/libdigidocpp.so.* 2 | -------------------------------------------------------------------------------- /debian/libdigidocpp-csharp.triggers: -------------------------------------------------------------------------------- 1 | activate-noawait ldconfig 2 | -------------------------------------------------------------------------------- /examples/java/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = "libdigidocpp" 2 | -------------------------------------------------------------------------------- /ID.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/ID.ico -------------------------------------------------------------------------------- /debian/libdigidocpp-python.install: -------------------------------------------------------------------------------- 1 | usr/lib/python3/dist-packages/ 2 | -------------------------------------------------------------------------------- /banner.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/banner.bmp -------------------------------------------------------------------------------- /dlgbmp.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/dlgbmp.bmp -------------------------------------------------------------------------------- /etc/Doxyfile.css: -------------------------------------------------------------------------------- 1 | #projectlogo > img { 2 | width: 55px; 3 | height: 55px; 4 | } 5 | -------------------------------------------------------------------------------- /doc/sample_files.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/doc/sample_files.zip -------------------------------------------------------------------------------- /test/data/test.asice: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/test.asice -------------------------------------------------------------------------------- /test/data/test.asics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/test.asics -------------------------------------------------------------------------------- /test/data/test2.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/test2.bin -------------------------------------------------------------------------------- /test/data/tsl.asice: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/tsl.asice -------------------------------------------------------------------------------- /debian/libdigidocpp-csharp.install: -------------------------------------------------------------------------------- 1 | usr/include/digidocpp_csharp/ 2 | usr/lib/*/libdigidoc_csharp.so 3 | -------------------------------------------------------------------------------- /test/data/signer1.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/signer1.p12 -------------------------------------------------------------------------------- /test/data/signer2.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/signer2.p12 -------------------------------------------------------------------------------- /test/data/signer3.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/signer3.p12 -------------------------------------------------------------------------------- /test/data/signerEC.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/signerEC.p12 -------------------------------------------------------------------------------- /test/data/test-meta.asics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/test-meta.asics -------------------------------------------------------------------------------- /test/data/test-tera.asics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/test-tera.asics -------------------------------------------------------------------------------- /test/data/test-invalid.asics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/test-invalid.asics -------------------------------------------------------------------------------- /test/data/test-invalidts.asics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/test-invalidts.asics -------------------------------------------------------------------------------- /debian/libdigidocpp-java.install: -------------------------------------------------------------------------------- 1 | usr/include/ee/ria/libdigidocpp/ 2 | usr/lib/*/libdigidoc_java.so 3 | usr/share/*/*.jar -------------------------------------------------------------------------------- /test/data/test-tera-empty.asics: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/test/data/test-tera-empty.asics -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/test.bdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/test.bdoc -------------------------------------------------------------------------------- /debian/libdigidocpp-dev.install: -------------------------------------------------------------------------------- 1 | usr/include/digidocpp/ 2 | usr/lib/*/libdigidocpp.so 3 | usr/lib/*/pkgconfig 4 | usr/lib/*/cmake 5 | -------------------------------------------------------------------------------- /examples/java/.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore Gradle project-specific cache directory 2 | .gradle 3 | 4 | # Ignore Gradle build output directory 5 | build 6 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | DEB_MAKE_CHECK_TARGET = test 3 | 4 | %: 5 | dh $@ 6 | 7 | override_dh_builddeb: 8 | dh_builddeb -- -Zgzip 9 | -------------------------------------------------------------------------------- /examples/android/app/src/main/res/raw/test.bdoc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/android/app/src/main/res/raw/test.bdoc -------------------------------------------------------------------------------- /examples/java/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/java/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | libdigidocpp (3.10.0) stable; urgency=low 2 | 3 | * Initial release 4 | 5 | -- RIA Tue, 15 Nov 2014 15:42:56 +0300 6 | -------------------------------------------------------------------------------- /examples/android/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/android/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Andrus Randveer 2 | Vambola Kotkas 3 | Janari Põld 4 | Janno Kusman 5 | Raul Metsma 6 | Kalev Lember 7 | Antti Andreimann 8 | Mark Erlich 9 | -------------------------------------------------------------------------------- /src/minizip/MiniZip64_Changes.txt: -------------------------------------------------------------------------------- 1 | 2 | MiniZip 1.1 was derived from MiniZip at version 1.01f 3 | 4 | Change in 1.0 (Okt 2009) 5 | - **TODO - Add history** 6 | 7 | -------------------------------------------------------------------------------- /examples/python/README.md: -------------------------------------------------------------------------------- 1 | # Build instructions for Python 2 | 3 | 1. Set digidocpp installation directory to PYTHONPATH if needed 4 | 2. Run 5 | 6 | python3 main.py 7 | -------------------------------------------------------------------------------- /examples/android/app/src/main/res/drawable-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/android/app/src/main/res/drawable-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/android/app/src/main/res/drawable-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/android/app/src/main/res/drawable-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/android/app/src/main/res/drawable-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/android/app/src/main/res/drawable-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /examples/android/app/src/main/res/drawable-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/android/app/src/main/res/drawable-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /debian/libdigidocpp-java.lintian-overrides: -------------------------------------------------------------------------------- 1 | libdigidocpp-java: sharedobject-in-library-directory-missing-soname 2 | libdigidocpp-java: package-has-unnecessary-activation-of-ldconfig-trigger 3 | -------------------------------------------------------------------------------- /debian/libdigidocpp-csharp.lintian-overrides: -------------------------------------------------------------------------------- 1 | libdigidocpp-csharp: sharedobject-in-library-directory-missing-soname 2 | libdigidocpp-csharp: package-has-unnecessary-activation-of-ldconfig-trigger 3 | -------------------------------------------------------------------------------- /examples/java/README.md: -------------------------------------------------------------------------------- 1 | # Build instructions for Java 2 | 3 | ## Build 4 | 5 | ./gradlew jar 6 | 7 | ## Run 8 | 9 | java -Djava.library.path=/some/path/lib -jar build/libs/libdigidoc.jar -------------------------------------------------------------------------------- /vcpkg-ports/libxml2/usage: -------------------------------------------------------------------------------- 1 | The package libxml2 is compatible with built-in CMake targets: 2 | 3 | find_package(LibXml2 REQUIRED) 4 | target_link_libraries(main PRIVATE LibXml2::LibXml2) 5 | -------------------------------------------------------------------------------- /vcpkg-ports/libxml2/vcpkg-cmake-wrapper.cmake: -------------------------------------------------------------------------------- 1 | list(REMOVE_ITEM ARGS "NO_MODULE" "CONFIG" "MODULE") 2 | _find_package(${ARGS} CONFIG) 3 | set(LIBXML2_FOUND "${LibXml2_FOUND}") # fphsa compatibility 4 | -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App-iPad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App-iPad.png -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App@2x.png -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App@3x.png -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-AppStore.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-AppStore.png -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-Settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-Settings.png -------------------------------------------------------------------------------- /vcpkg-ports/xmlsec/unofficial-xmlsec-config.cmake: -------------------------------------------------------------------------------- 1 | include(CMakeFindDependencyMacro) 2 | find_dependency(LibXml2) 3 | find_dependency(OpenSSL) 4 | include("${CMAKE_CURRENT_LIST_DIR}/unofficial-xmlsec-targets.cmake") 5 | -------------------------------------------------------------------------------- /examples/android/README.md: -------------------------------------------------------------------------------- 1 | # Build instructions for Android 2 | 3 | ### macOS 4 | 5 | 1. Install dependencies see [README.md](../../README.md#macOS) 6 | 2. Build example and run 7 | 8 | ./gradlew installDebug 9 | -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App-iPad-Pro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App-iPad-Pro.png -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App-iPad@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-App-iPad@2x.png -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-Settings@2x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-Settings@2x.png -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-Settings@3x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/open-eid/libdigidocpp/HEAD/examples/ios/libdigidocpp/Images.xcassets/AppIcon.appiconset/Icon-Settings@3x.png -------------------------------------------------------------------------------- /examples/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | include_directories( ${CMAKE_SOURCE_DIR}/src ) 2 | add_executable( pkcs11sign pkcs11sign.cpp ) 3 | set_target_properties( pkcs11sign PROPERTIES 4 | LINK_LIBRARIES digidocpp 5 | EXCLUDE_FROM_ALL yes 6 | ) 7 | -------------------------------------------------------------------------------- /examples/android/settings.gradle: -------------------------------------------------------------------------------- 1 | dependencyResolutionManagement { 2 | repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | } 8 | include ':app' 9 | -------------------------------------------------------------------------------- /examples/android/app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Libdigidocpp 5 | Run 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/ios/libdigidocpp.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /examples/android/app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /examples/android/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Thu Jan 28 21:20:48 EET 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip 7 | -------------------------------------------------------------------------------- /examples/java/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip 4 | networkTimeout=10000 5 | validateDistributionUrl=true 6 | zipStoreBase=GRADLE_USER_HOME 7 | zipStorePath=wrapper/dists 8 | -------------------------------------------------------------------------------- /vcpkg-triplets/x64-android.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE x64) 2 | set(VCPKG_CRT_LINKAGE static) 3 | set(VCPKG_LIBRARY_LINKAGE static) 4 | set(VCPKG_CMAKE_SYSTEM_NAME Android) 5 | set(VCPKG_CMAKE_SYSTEM_VERSION 30) 6 | set(VCPKG_MAKE_BUILD_TRIPLET "--host=x86_64-linux-android") 7 | set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=x86_64) 8 | -------------------------------------------------------------------------------- /vcpkg-triplets/arm64-android.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE arm64) 2 | set(VCPKG_CRT_LINKAGE static) 3 | set(VCPKG_LIBRARY_LINKAGE static) 4 | set(VCPKG_CMAKE_SYSTEM_NAME Android) 5 | set(VCPKG_CMAKE_SYSTEM_VERSION 30) 6 | set(VCPKG_MAKE_BUILD_TRIPLET "--host=aarch64-linux-android") 7 | set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=arm64-v8a) 8 | -------------------------------------------------------------------------------- /vcpkg-triplets/arm-neon-android.cmake: -------------------------------------------------------------------------------- 1 | set(VCPKG_TARGET_ARCHITECTURE arm) 2 | set(VCPKG_CRT_LINKAGE static) 3 | set(VCPKG_LIBRARY_LINKAGE static) 4 | set(VCPKG_CMAKE_SYSTEM_NAME Android) 5 | set(VCPKG_CMAKE_SYSTEM_VERSION 30) 6 | set(VCPKG_MAKE_BUILD_TRIPLET "--host=armv7a-linux-androideabi") 7 | set(VCPKG_CMAKE_CONFIGURE_OPTIONS -DANDROID_ABI=armeabi-v7a -DANDROID_ARM_NEON=ON) 8 | -------------------------------------------------------------------------------- /src/libdigidocpp.pc.cmake: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=@CMAKE_INSTALL_FULL_BINDIR@ 3 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ 4 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ 5 | 6 | Name: libdigidocpp 7 | Description: Libdigidocpp C++ library for handling digitally signed documents 8 | Version: @PROJECT_VERSION@ 9 | Libs: -L${libdir} -ldigidocpp 10 | Cflags: -I${includedir} 11 | -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/main.mm: -------------------------------------------------------------------------------- 1 | // 2 | // main.m 3 | // libdigidocpp-ios 4 | // 5 | // Created by Raul Metsma on 18/07/15. 6 | // Copyright (c) 2015 RIA. All rights reserved. 7 | // 8 | 9 | #import "AppDelegate.h" 10 | 11 | int main(int argc, char * argv[]) { 12 | @autoreleasepool { 13 | return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class])); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /examples/android/build.gradle: -------------------------------------------------------------------------------- 1 | // Top-level build file where you can add configuration options common to all sub-projects/modules. 2 | buildscript { 3 | repositories { 4 | google() 5 | mavenCentral() 6 | } 7 | dependencies { 8 | classpath 'com.android.tools.build:gradle:8.13.0' 9 | } 10 | } 11 | 12 | tasks.register('clean', Delete) { 13 | delete layout.buildDirectory 14 | } 15 | -------------------------------------------------------------------------------- /examples/ios/README.md: -------------------------------------------------------------------------------- 1 | # Build instructions for iOS 2 | 3 | ### macOS 4 | 5 | 1. Install dependencies see [README.md](../../README.md#macOS) 6 | 2. Build example 7 | 8 | xcodebuild -project libdigidocpp.xcodeproj 9 | 10 | 3. Execute 11 | 12 | Open Xcode project and run on simulator 13 | 14 | 15 | AppDelegate.mm contains how to override digidoc::XmlConf to point right cache folder for TSL lists. 16 | -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/libdigidocpp.entitlements: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | com.apple.security.app-sandbox 6 | 7 | com.apple.security.cs.disable-library-validation 8 | 9 | com.apple.security.network.client 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /vcpkg-ports/libxml2/cxx-for-icu.diff: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index b952d7bf..6d43569b 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -8,7 +8,7 @@ if(${VERSION} MATCHES [[([0-9]+)\.([0-9]+)\.([0-9]+)]]) 6 | set(LIBXML_MICRO_VERSION ${CMAKE_MATCH_3}) 7 | endif() 8 | 9 | -project(libxml2 VERSION ${VERSION} LANGUAGES C) 10 | +project(libxml2 VERSION ${VERSION} LANGUAGES C CXX) 11 | 12 | set(CMAKE_C_STANDARD 11) 13 | 14 | -------------------------------------------------------------------------------- /src/setup.py.cmake: -------------------------------------------------------------------------------- 1 | from distutils.core import setup 2 | 3 | setup( 4 | name='digidocpp', 5 | version='${VERSION}', 6 | license='LGPL 2.1', 7 | author='RIA', 8 | author_email='info@ria.ee', 9 | url='https://open-eid.github.io/libdigidocpp/', 10 | description='DigiDoc digital signature library', 11 | packages=['digidoc'], 12 | package_dir={'digidoc': 'src'}, 13 | package_data={'digidoc': ['digidoc.py', '_digidoc_python*.so']} 14 | ) 15 | -------------------------------------------------------------------------------- /vcpkg-ports/xmlsec/xmlsec-config.cmake: -------------------------------------------------------------------------------- 1 | file(READ "${CMAKE_CURRENT_LIST_DIR}/usage" usage) 2 | message(WARNING "find_package(xmlsec) is deprecated.\n${usage}") 3 | include(CMakeFindDependencyMacro) 4 | find_dependency(unofficial-xmlsec CONFIG REQUIRED) 5 | if(NOT TARGET xmlsec1) 6 | add_library(xmlsec1 ALIAS unofficial::xmlsec::xmlsec1) 7 | endif() 8 | if(NOT TARGET xmlsec1-openssl) 9 | add_library(xmlsec1-openssl ALIAS unofficial::xmlsec::xmlsec1-openssl) 10 | endif() 11 | -------------------------------------------------------------------------------- /examples/DigiDocCSharp/DigiDocCSharp.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | net472 4 | Exe 5 | 0.6.0.0 6 | Copyright © 2015 7 | 8 | 9 | $(DefineConstants);_WINDOWS 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Example folder 2 | 3 | Contents of this folder is provided on as is terms, whithout support. 4 | 5 | * [DigiDocCSharp](./DigiDocCSharp/README.md) - example project to use C# on Windows 6 | * [android](./android/README.md) - example project to use on Android platform 7 | * [ios](./ios/README.md) - example project to use on iOS platform 8 | * [java](./java/README.md) - example project to use with java 9 | * [python](./python/README.md) - example project to use with python 10 | * [pkcs11sign.cpp](pkcs11sign.cpp) - Simple PKCS11Signer example 11 | -------------------------------------------------------------------------------- /examples/ios/libdigidocpp/AppDelegate.h: -------------------------------------------------------------------------------- 1 | // 2 | // AppDelegate.h 3 | // libdigidocpp-ios 4 | // 5 | // Created by Raul Metsma on 18/07/15. 6 | // Copyright (c) 2015 RIA. All rights reserved. 7 | // 8 | 9 | #import 10 | 11 | namespace digidoc { class Container; } 12 | 13 | @interface AppDelegate : UIResponder 14 | 15 | @property (strong, nonatomic) UIWindow *window; 16 | @property (assign, nonatomic) digidoc::Container *doc; 17 | 18 | @end 19 | 20 | #define APP ((AppDelegate*)UIApplication.sharedApplication.delegate) 21 | -------------------------------------------------------------------------------- /vcpkg-ports/libxml2/disable-xml2-config.diff: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index 3850f6b..8beb11e 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -669,7 +669,6 @@ if(1) 6 | set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..") 7 | endif() 8 | configure_file(xml2-config.in xml2-config @ONLY) 9 | -install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/xml2-config DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT development) 10 | 11 | set(XML_INCLUDEDIR "-I${CMAKE_INSTALL_FULL_INCLUDEDIR}/libxml2") 12 | set(XML_LIBDIR "-L${CMAKE_INSTALL_FULL_LIBDIR}") 13 | -------------------------------------------------------------------------------- /test/data/comma.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBcjCB+QIJAKIsqQxqAGX3MAoGCCqGSM49BAMCMCMxCzAJBgNVBAYTAkVFMRQw 3 | EgYDVQQDDAt0ZXN0LCBjb21tYTAeFw0yNDA4MjcwODM4MDlaFw0yNTA4MjcwODM4 4 | MDlaMCMxCzAJBgNVBAYTAkVFMRQwEgYDVQQDDAt0ZXN0LCBjb21tYTB2MBAGByqG 5 | SM49AgEGBSuBBAAiA2IABKoUm0pDszqGu4HyjABAYB0FhAgEN+G1QNEEEXjz0jRK 6 | rlu7PqV3Bj+4Wz222KBUpViaZZdTuZFLDbEL7legmfNMeOiQK2SQiYRrclFhZVaE 7 | laqSW0BNqI6wIevp/IgSmjAKBggqhkjOPQQDAgNoADBlAjBFyjog1pDn0J5azKuK 8 | AwTqnTVYxWgeNsYpfgzQ1BYs9jEs/x/FoEgRX7sqeL9TCksCMQC6CG34jBdM3stY 9 | 1czLqKJjqRgZ9yg4wSgPABHYICjTW0TfuCTPLa7pMlL6mrWeAhg= 10 | -----END CERTIFICATE----- 11 | -------------------------------------------------------------------------------- /cmake/modules/FindPKCS11.cmake: -------------------------------------------------------------------------------- 1 | # - Find pkcs11 2 | # Find the PKCS11 module 3 | # 4 | # PKCS11_MODULE - pkcs11 module path and name 5 | # PKCS11_FOUND - True if pkcs11 module found. 6 | 7 | if(APPLE) 8 | find_library(PKCS11_MODULE NAMES opensc-pkcs11.so HINTS /Library/OpenSC/lib) 9 | elseif(WIN32) 10 | if(NOT PKCS11_MODULE) 11 | set(PKCS11_MODULE opensc-pkcs11.dll) 12 | endif() 13 | else() 14 | if(NOT PKCS11_MODULE) 15 | set(PKCS11_MODULE opensc-pkcs11.so) 16 | endif() 17 | endif() 18 | 19 | include(FindPackageHandleStandardArgs) 20 | FIND_PACKAGE_HANDLE_STANDARD_ARGS(PKCS11 DEFAULT_MSG PKCS11_MODULE) 21 | MARK_AS_ADVANCED(PKCS11) 22 | -------------------------------------------------------------------------------- /src/digidoc-tool.manifest: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | UTF-8 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "libdigidocpp", 3 | "dependencies": [ 4 | { 5 | "name": "libxml2", 6 | "default-features": false, 7 | "platform": "!osx & !ios" 8 | }, 9 | "xmlsec", 10 | { 11 | "name": "zlib", 12 | "platform": "!osx & !ios" 13 | } 14 | ], 15 | "features": { 16 | "tests": { "description": "Build tests", "dependencies": ["boost-test"] } 17 | }, 18 | "builtin-baseline": "bc38a15b0bee8bc48a49ea267cc32fbb49aedfc4", 19 | "vcpkg-configuration": { 20 | "overlay-triplets": ["./vcpkg-triplets"], 21 | "overlay-ports": ["vcpkg-ports/libxml2", "vcpkg-ports/xmlsec"] 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /test/data/unicode.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIBrzCCATSgAwIBAgIUY4FFQCr+NosViC+Df8jN2YLPRlowCgYIKoZIzj0EAwQw 3 | JzELMAkGA1UEBhMCRUUxGDAWBgNVBAMMD3VuaWNvZGXDtsOkw7zDtTAeFw0yNDAz 4 | MjEwODUzMDNaFw0yNTAzMjEwODUzMDNaMCcxCzAJBgNVBAYTAkVFMRgwFgYDVQQD 5 | DA91bmljb2Rlw7bDpMO8w7UwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAASD7s3frcVc 6 | edqPaXc0+gV2A/9+IlzMEw23hPMd3LtGrky8oKoKdUe7yoSNANuXCWFY74ILO6Rb 7 | 3MPJM1UCKgESPStCz0hsGWezXnuocq8DjleBHbzkkl1GbmuLamhiZRKjITAfMB0G 8 | A1UdDgQWBBRJEw8vPxzWhlsqQmlgjAiAEy9OTzAKBggqhkjOPQQDBANpADBmAjEA 9 | mYYl7bT4HvIDwn/TB+Cbqr5lq9BWYHI9UpRpfmJB+0XVQudgTGg+RpTtslE2i8K9 10 | AjEA3j7csBEidefaJuIoBjJSYYGAxxXIwlhZQ7I9Zj60C1adYh4aSUASMnw9J6FU 11 | nX2A 12 | -----END CERTIFICATE----- 13 | -------------------------------------------------------------------------------- /examples/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 11 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /vcpkg-ports/libxml2/fix_ios_compilation.patch: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index b952d7bf..d555d25a 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -134,7 +134,12 @@ check_c_source_compiles(" 6 | f(void) {} 7 | int main(void) { return 0; } 8 | " HAVE_FUNC_ATTRIBUTE_DESTRUCTOR) 9 | -check_symbol_exists(getentropy "sys/random.h" HAVE_DECL_GETENTROPY) 10 | +if (APPLE) 11 | + # In old macOS SDKs (ex: 10.15), sys/random.h fails to include header files it needs, so add them here. 12 | + check_symbol_exists(getentropy "Availability.h;stddef.h;sys/random.h" HAVE_GETENTROPY) 13 | +else() 14 | + check_symbol_exists(getentropy sys/random.h HAVE_GETENTROPY) 15 | +endif() 16 | check_symbol_exists(glob "glob.h" HAVE_DECL_GLOB) 17 | check_symbol_exists(mmap "sys/mman.h" HAVE_DECL_MMAP) 18 | check_include_files(stdint.h HAVE_STDINT_H) 19 | -------------------------------------------------------------------------------- /vcpkg-ports/xmlsec/usage: -------------------------------------------------------------------------------- 1 | xmlsec can be imported via CMake FindPkgConfig module: 2 | 3 | find_package(PkgConfig) 4 | # For dynamic loading of xmlsec crypto library 5 | pkg_check_modules(XMLSEC1 REQUIRED IMPORTED_TARGET xmlsec1) 6 | target_link_libraries(main PRIVATE PkgConfig::XMLSEC1) 7 | # For selecting the openssl crypto engine at link time 8 | pkg_check_modules(XMLSEC1_OPENSSL REQUIRED IMPORTED_TARGET xmlsec1-openssl) 9 | target_link_libraries(main PRIVATE PkgConfig::XMLSEC1_OPENSSL) 10 | 11 | vcpkg provides proprietary CMake targets: 12 | 13 | find_package(unofficial-xmlsec CONFIG REQUIRED) 14 | # For dynamic loading of xmlsec crypto library 15 | target_link_libraries(main PRIVATE unofficial::xmlsec::xmlsec1) 16 | # For selecting the openssl crypto engine at link time 17 | target_link_libraries(main PRIVATE unofficial::xmlsec::xmlsec1-openssl) 18 | -------------------------------------------------------------------------------- /src/minizip/iowin32.h: -------------------------------------------------------------------------------- 1 | /* iowin32.h -- IO base function header for compress/uncompress .zip 2 | Version 1.1, February 14h, 2010 3 | part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) 4 | 5 | Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) 6 | 7 | Modifications for Zip64 support 8 | Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) 9 | 10 | For more info read MiniZip_info.txt 11 | 12 | */ 13 | 14 | #include 15 | 16 | 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | 21 | void fill_win32_filefunc(zlib_filefunc_def* pzlib_filefunc_def); 22 | void fill_win32_filefunc64(zlib_filefunc64_def* pzlib_filefunc_def); 23 | void fill_win32_filefunc64A(zlib_filefunc64_def* pzlib_filefunc_def); 24 | void fill_win32_filefunc64W(zlib_filefunc64_def* pzlib_filefunc_def); 25 | 26 | #ifdef __cplusplus 27 | } 28 | #endif 29 | -------------------------------------------------------------------------------- /test/data/digidocpp.conf: -------------------------------------------------------------------------------- 1 | 2 | 3 | 2 4 | digidocpp-test.log 5 | http://www.w3.org/2001/04/xmlenc#sha512 6 | opensc-pkcs11 7 | host 8 | port 9 | user 10 | pass 11 | cert 12 | pass 13 | true 14 | http://ocsp.issuer.com 15 | 16 | -------------------------------------------------------------------------------- /vcpkg-ports/xmlsec/pkgconfig_fixes.patch: -------------------------------------------------------------------------------- 1 | diff --git a/xmlsec-openssl.pc.in b/xmlsec-openssl.pc.in 2 | index af3ae29..40635cf 100644 3 | --- a/xmlsec-openssl.pc.in 4 | +++ b/xmlsec-openssl.pc.in 5 | @@ -8,5 +8,4 @@ Version: @VERSION@ 6 | Description: XML Security Library implements XML Signature and XML Encryption standards 7 | Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_PC_FILE_COND@ 8 | Cflags: @XMLSEC_OPENSSL_CFLAGS@ 9 | -Cflags.private: -DXMLSEC_STATIC 10 | Libs: @XMLSEC_OPENSSL_LIBS@ 11 | diff --git a/xmlsec.pc.in b/xmlsec.pc.in 12 | index 2d5a3ad..0f72d68 100644 13 | --- a/xmlsec.pc.in 14 | +++ b/xmlsec.pc.in 15 | @@ -7,5 +7,5 @@ Name: xmlsec1 16 | Version: @VERSION@ 17 | Description: XML Security Library implements XML Signature and XML Encryption standards 18 | Requires: libxml-2.0 >= @LIBXML_MIN_VERSION@ @LIBXSLT_PC_FILE_COND@ 19 | -Cflags: -DXMLSEC_CRYPTO_DYNAMIC_LOADING=1 @XMLSEC_CORE_CFLAGS@ 20 | +Cflags: @XMLSEC_CORE_CFLAGS@ 21 | Libs: -L${libdir} @XMLSEC_CORE_LIBS@ 22 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Contact: info@ria.ee 3 | Source: https://github.com/open-eid/libdigidocpp 4 | 5 | Files: * 6 | Copyright: 2012-2024 Estonian Information System's Authority 7 | License: LGPL-2.1 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | . 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | . 18 | You should have received a copy of the GNU Lesser General Public 19 | License with your system, in /usr/share/common-licenses/LGPL-2.1 20 | If not, see . 21 | -------------------------------------------------------------------------------- /test/data/test.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICnjCCAYYCCQC6vh+Qdj8IyzANBgkqhkiG9w0BAQsFADARMQ8wDQYDVQQDDAYi 3 | dGVzdCIwHhcNMjAxMTI0MDY1NTI2WhcNMjExMTI0MDY1NTI2WjARMQ8wDQYDVQQD 4 | DAYidGVzdCIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCxdaAq1Ty0 5 | zalS1AVsyFmFePreRbCbpggM+ullNIL4TEwISDBsUXZvQxf9kH8G7PtwF93Vo2cO 6 | eCtT5cL/NGZobuQz/sx8AgsrknxV7q/xMZ2l60QtNRuGWjXcpS5grigPa6mO06TH 7 | TQGHwNS8p37s7HrUfueXqQDLdgDu9HuL6P/W5Kd59mFRBfbEwaw85g5n0HIMn8DD 8 | bmJrJzPAVskbR6kmFYtUa4zROVeuwEsG2B4lNVs7Z62+3vMvMqxFFCndMiRmb2+q 9 | PKl5qChCKlz0EUN4jI+rkh9baGxlyVmXMEf+UG+ijURfOJUgPIKZ/6lzB7EHf3Vd 10 | F89rNQLKdAIbAgMBAAEwDQYJKoZIhvcNAQELBQADggEBAH4tLaCQKXBHfHI3xLzD 11 | a3zmfV/4VZn54AMtrkO8o3502Jm2gDrR5PidvCDi880TEhysPL6pvaRBeUb+dCcS 12 | xyHIkX4x0GLiQ3z+fQlycr+0z5C3jACLV3/0h8k63WVE7RjXHi8DRs0UPXYicBem 13 | UXjB2zfPzPvdt9MgoQA7VC18u6CkEmG+5edrcxOc08hHHG/uAa03xqHvOSKYwPuA 14 | OolAajbV6AexzcMoarAxKzv5sdhR/VXWbM/N9op+BXyHrOyGkE/DMeCcn+B1Axht 15 | 3I6sb29NM+5HA6Y+fj3T1BAItLE+XTMSlDejVt3YVr70KRCCPPqlfli9na+uiIe8 16 | Bqk= 17 | -----END CERTIFICATE----- 18 | -------------------------------------------------------------------------------- /vcpkg-ports/xmlsec/vcpkg.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "xmlsec", 3 | "version": "1.3.9", 4 | "description": "XML Security Library is a C library based on LibXML2. The library supports major XML security standards.", 5 | "homepage": "https://www.aleksey.com/xmlsec/", 6 | "license": "X11 AND MPL-1.1", 7 | "supports": "!xbox & !uwp", 8 | "dependencies": [ 9 | { 10 | "name": "libxml2", 11 | "default-features": false, 12 | "platform": "!osx & !ios" 13 | }, 14 | "openssl", 15 | { 16 | "name": "vcpkg-cmake", 17 | "host": true 18 | }, 19 | { 20 | "name": "vcpkg-cmake-config", 21 | "host": true 22 | } 23 | ], 24 | "features": { 25 | "tools": { 26 | "description": "Build tools" 27 | }, 28 | "with-dl": { 29 | "description": "Build with dynamic loading of xmlsec-crypto libraries", 30 | "supports": "!static", 31 | "dependencies": [ 32 | { 33 | "name": "libltdl", 34 | "platform": "!windows" 35 | } 36 | ] 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/libdigidocpp.rc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | VS_VERSION_INFO VERSIONINFO 4 | FILEVERSION VERSION 5 | PRODUCTVERSION VERSION 6 | FILEFLAGSMASK VS_FFI_FILEFLAGSMASK 7 | #ifdef _DEBUG 8 | FILEFLAGS VS_FF_DEBUG 9 | #else 10 | FILEFLAGS 0x0L 11 | #endif 12 | FILEOS VOS_NT_WINDOWS32 13 | #ifdef APP 14 | FILETYPE VFT_APP 15 | #else 16 | FILETYPE VFT_DLL 17 | #endif 18 | FILESUBTYPE VFT_UNKNOWN 19 | BEGIN 20 | BLOCK "StringFileInfo" 21 | BEGIN 22 | BLOCK "040904B0" 23 | BEGIN 24 | VALUE "CompanyName", "RIA" 25 | VALUE "FileDescription", TARGET_NAME 26 | VALUE "FileVersion", VERSION_STR 27 | VALUE "InternalName", TARGET_NAME 28 | VALUE "LegalCopyright", "(C) 2009-2024 Estonian Information System Authority" 29 | #ifdef APP 30 | VALUE "OriginalFilename", TARGET_NAME ".exe" 31 | #else 32 | VALUE "OriginalFilename", TARGET_NAME ".dll" 33 | #endif 34 | VALUE "ProductName", TARGET_NAME 35 | VALUE "ProductVersion", VERSION_STR 36 | END 37 | END 38 | BLOCK "VarFileInfo" 39 | BEGIN 40 | VALUE "Translation", 0x409, 1200 41 | END 42 | END 43 | /* End of Version info */ 44 | -------------------------------------------------------------------------------- /etc/schema/conf.xsd: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /examples/java/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'java' 3 | } 4 | group = 'ee.ria' 5 | java { 6 | targetCompatibility = JavaVersion.VERSION_17 7 | sourceCompatibility = JavaVersion.VERSION_17 8 | } 9 | base { 10 | archivesName = 'libdigidocpp' 11 | } 12 | jar { 13 | manifest { 14 | attributes 'Main-Class': 'ee.ria.libdigidocpp.libdigidocpp' 15 | } 16 | } 17 | def digidocppJarPath = '/usr/share/digidocpp/digidocpp.jar' 18 | def nativeLibDir = null 19 | if (System.properties['os.name'].toLowerCase().contains('windows')) { 20 | digidocppJarPath = 'C:\\Program Files\\libdigidocpp\\digidocpp.jar' 21 | nativeLibDir = 'C:\\Program Files\\libdigidocpp' 22 | } else if (System.properties['os.name'].toLowerCase().contains('mac')) { 23 | digidocppJarPath = '/Library/Java/Extensions/digidocpp.jar' 24 | } 25 | dependencies { 26 | implementation files(digidocppJarPath) 27 | } 28 | tasks.withType(JavaExec).configureEach { 29 | if (nativeLibDir != null) { 30 | environment 'PATH', "${nativeLibDir};" + System.getenv('PATH') 31 | jvmArgs "-Djava.library.path=${nativeLibDir}" 32 | } 33 | } -------------------------------------------------------------------------------- /examples/pkcs11sign.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | using namespace digidoc; 9 | 10 | static std::ostream &operator<<(std::ostream &s, const Exception &e) 11 | { 12 | s << e.file() << ":" << e.line() << " code(" << e.code() << ") " << e.msg() << std::endl; 13 | for(const Exception &ex: e.causes()) 14 | s << ex; 15 | return s; 16 | } 17 | 18 | int main() 19 | { 20 | try 21 | { 22 | digidoc::initialize(); 23 | std::unique_ptr doc(Container::createPtr("/tmp/test.asice")); 24 | std::unique_ptr s(new std::stringstream); 25 | *s << "test"; 26 | doc->addDataFile(std::move(s), "test.txt", "text/plain"); 27 | PKCS11Signer signer; 28 | signer.setPin("00000"); 29 | signer.setProfile("BES"); 30 | doc->sign(&signer); 31 | doc->save(); 32 | digidoc::terminate(); 33 | } 34 | catch(const Exception &e) 35 | { 36 | std::cout << e; 37 | } 38 | 39 | return 0; 40 | } 41 | -------------------------------------------------------------------------------- /test/data/xml-bomb-cont.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | ]> 15 | 16 | &lol9; 17 | -------------------------------------------------------------------------------- /src/SignatureCAdES_p.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdigidocpp 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | 20 | #pragma once 21 | 22 | #include 23 | #include 24 | 25 | #include 26 | 27 | namespace digidoc { 28 | 29 | class SignatureCAdESPrivate: public std::shared_ptr 30 | { 31 | public: 32 | CMS_SignerInfo *si = nullptr; 33 | RSA_METHOD method; 34 | }; 35 | } 36 | -------------------------------------------------------------------------------- /examples/android/gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | # IDE (e.g. Android Studio) users: 3 | # Gradle settings configured through the IDE *will override* 4 | # any settings specified in this file. 5 | # For more details on how to configure your build environment visit 6 | # http://www.gradle.org/docs/current/userguide/build_environment.html 7 | # Specifies the JVM arguments used for the daemon process. 8 | # The setting is particularly useful for tweaking memory settings. 9 | org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8 10 | # When configured, Gradle will run in incubating parallel mode. 11 | # This option should only be used with decoupled projects. More details, visit 12 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 13 | # org.gradle.parallel=true 14 | # AndroidX package structure to make it clearer which packages are bundled with the 15 | # Android operating system, and which are packaged with your app"s APK 16 | # https://developer.android.com/topic/libraries/support-library/androidx-rn 17 | android.useAndroidX=true 18 | org.gradle.unsafe.configuration-cache=true 19 | android.nonTransitiveRClass=true 20 | android.nonFinalResIds=true -------------------------------------------------------------------------------- /vcpkg-ports/libxml2/fix_cmakelist.patch: -------------------------------------------------------------------------------- 1 | diff --git a/CMakeLists.txt b/CMakeLists.txt 2 | index b952d7bf..9196ebe4 100644 3 | --- a/CMakeLists.txt 4 | +++ b/CMakeLists.txt 5 | @@ -425,7 +425,7 @@ set_target_properties( 6 | MACHO_CURRENT_VERSION "${LIBXML_MACHO_COMPAT}.${LIBXML_MICRO_VERSION}" 7 | ) 8 | 9 | -if(MSVC) 10 | +if(0) 11 | if(BUILD_SHARED_LIBS) 12 | set_target_properties( 13 | LibXml2 14 | @@ -634,7 +634,11 @@ list(JOIN XML_PRIVATE_LIBS " " XML_PRIVATE_LIBS) 15 | 16 | set(XML_INCLUDEDIR "-I\${includedir}/libxml2") 17 | set(XML_LIBDIR "-L\${libdir}") 18 | +if(NOT MSVC) 19 | set(XML_LIBS "-lxml2") 20 | +else() 21 | +set(XML_LIBS "-llibxml2") 22 | +endif() 23 | 24 | if(BUILD_SHARED_LIBS) 25 | set(XML_PC_PRIVATE ".private") 26 | @@ -669,7 +673,7 @@ set(includedir "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}") 27 | configure_file(libxml-2.0.pc.in libxml-2.0.pc @ONLY) 28 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libxml-2.0.pc DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig COMPONENT development) 29 | 30 | -if(WIN32) 31 | +if(1) 32 | set(prefix "\$(cd \"\$(dirname \"\$0\")\"; pwd -P)/..") 33 | endif() 34 | configure_file(xml2-config.in xml2-config @ONLY) 35 | -------------------------------------------------------------------------------- /examples/DigiDocCSharp/DigiDocCSharp.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.7.34009.444 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DigiDocCSharp", "DigiDocCSharp.csproj", "{DDEE2029-EA2A-49D2-80CB-F0E2E396B005}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DDEE2029-EA2A-49D2-80CB-F0E2E396B005}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {DDEE2029-EA2A-49D2-80CB-F0E2E396B005}.Debug|Any CPU.Build.0 = Debug|Any CPU 16 | {DDEE2029-EA2A-49D2-80CB-F0E2E396B005}.Release|Any CPU.ActiveCfg = Release|Any CPU 17 | {DDEE2029-EA2A-49D2-80CB-F0E2E396B005}.Release|Any CPU.Build.0 = Release|Any CPU 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | GlobalSection(ExtensibilityGlobals) = postSolution 23 | SolutionGuid = {7D43E58D-0FD9-4023-A18F-D69EE6A229E1} 24 | EndGlobalSection 25 | EndGlobal 26 | -------------------------------------------------------------------------------- /src/crypto/X509Crypto.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdigidocpp 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | 20 | #pragma once 21 | 22 | #include "X509Cert.h" 23 | 24 | namespace digidoc 25 | { 26 | class X509Crypto 27 | { 28 | 29 | public: 30 | X509Crypto(X509Cert cert); 31 | 32 | bool compareIssuerToDer(const std::vector &issuer) const; 33 | int compareIssuerToString(std::string_view name) const; 34 | bool isRSAKey() const; 35 | 36 | private: 37 | X509Cert cert; 38 | }; 39 | } 40 | -------------------------------------------------------------------------------- /src/util/DateTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * libdigidocpp 3 | * 4 | * This library is free software; you can redistribute it and/or 5 | * modify it under the terms of the GNU Lesser General Public 6 | * License as published by the Free Software Foundation; either 7 | * version 2.1 of the License, or (at your option) any later version. 8 | * 9 | * This library is distributed in the hope that it will be useful, 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 | * Lesser General Public License for more details. 13 | * 14 | * You should have received a copy of the GNU Lesser General Public 15 | * License along with this library; if not, write to the Free Software 16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 17 | * 18 | */ 19 | 20 | #pragma once 21 | 22 | #include 23 | #include 24 | 25 | namespace digidoc 26 | { 27 | namespace util 28 | { 29 | class date 30 | { 31 | public: 32 | static struct tm gmtime(time_t t); 33 | static bool is_empty(const tm &t); 34 | static time_t mkgmtime(tm &t); 35 | static std::string to_string(time_t t); 36 | static std::string to_string(const tm &date); 37 | }; 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /examples/android/app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 11 | 12 | 19 | 20 |