├── library ├── test │ ├── data │ │ ├── .gitignore │ │ ├── test-fox.txt │ │ ├── test-diia.p12 │ │ ├── certs │ │ │ ├── diia-test-kep-7775604.cer │ │ │ ├── diia-test-sign-7775603.cer │ │ │ ├── CAO-05E19E2CD92EA2990100000001000000C1000000.cer │ │ │ ├── diia-CA-05E19E2CD92EA2990100000001000000E1000000.cer │ │ │ ├── diia-ocsp-3ED5083160DBC59B0200000001000000202B0F00.cer │ │ │ └── diia-2023-tsp-05E19E2CD92EA29902000000010000004A010000.cer │ │ └── crls │ │ │ └── BED5083160DBC59BCDDF707C10293F58BB6ED263C6EA5893D3781B61F493BE57-delta-0ABEA7.crl │ └── CMakeLists.txt ├── uapkic │ ├── Application-all.mk │ ├── include │ │ ├── drbg.h │ │ ├── uapkic-export.h │ │ ├── pbkdf.h │ │ ├── paddings.h │ │ └── dstu8845.h │ ├── Android.mk │ └── src │ │ ├── entropy-internal.h │ │ └── math-ec-point-internal.h ├── uapkif │ ├── Application-all.mk │ └── include │ │ ├── uapkif-export.h │ │ ├── T61String.h │ │ ├── GeneralString.h │ │ ├── TeletexString.h │ │ ├── GraphicString.h │ │ ├── ObjectDescriptor.h │ │ ├── ISO646String.h │ │ ├── NumericString.h │ │ ├── VisibleString.h │ │ ├── PrintableString.h │ │ ├── ENUMERATED.h │ │ ├── UTCTime.h │ │ ├── IA5String.h │ │ ├── asn1-errors.h │ │ ├── GeneralizedTime.h │ │ ├── BMPString.h │ │ ├── UniversalString.h │ │ ├── IITParams.h │ │ ├── per_opentype.h │ │ ├── RSAPublicKey.h │ │ ├── OtherPrimeInfo.h │ │ ├── Validity.h │ │ ├── GOST34310Sign.h │ │ ├── SequenceOfANY.h │ │ ├── CertBag.h │ │ ├── KepGost28147Params.h │ │ ├── NULL.h │ │ ├── OtherPrimeInfos.h │ │ ├── Pentanomial.h │ │ ├── ECDSA-Sig-Value.h │ │ ├── OtherName.h │ │ ├── PKIFreeText.h │ │ ├── Hash.h │ │ ├── KepDSTU4145Params.h │ │ ├── ContentInfo.h │ │ ├── Attributes.h │ │ ├── SecretBag.h │ │ └── GOST28147Params.h ├── common │ ├── curl │ │ ├── builds │ │ │ ├── windows_x86 │ │ │ │ └── libcurl.lib │ │ │ └── windows_x86-64 │ │ │ │ └── libcurl.lib │ │ └── include │ │ │ └── curl │ │ │ ├── stdcheaders.h │ │ │ └── mprintf.h │ ├── pkix │ │ ├── dstu4145-params.h │ │ ├── iconv-utils.h │ │ ├── aid.h │ │ ├── dstu-ns.h │ │ └── key-wrap.h │ └── cm-api │ │ └── cm-export.h ├── build-uapki-x64.bat ├── build-uapki-x86.bat ├── hostapp │ ├── uapki-hostapp.vcxproj.filters │ ├── CMakeLists.txt │ └── uapki-hostapp-debug.h ├── uapki │ ├── src │ │ ├── api │ │ │ ├── storage-close.cpp │ │ │ ├── provider-list-storages.cpp │ │ │ ├── library-deinit.cpp │ │ │ ├── library-version.cpp │ │ │ ├── provider-storage-info.cpp │ │ │ ├── storage-change-password.cpp │ │ │ ├── session-key-delete.cpp │ │ │ └── library-list-providers.cpp │ │ ├── global-objects.h │ │ ├── verify-status.cpp │ │ ├── verify-status.h │ │ ├── dirent-internal.h │ │ └── signature-format.h │ └── include │ │ └── uapki-export.h └── cm-pkcs12 │ └── src │ ├── storage │ └── jks-utils.h │ └── cm-pkcs12-ctx.h ├── integration ├── Net │ ├── .gitignore │ ├── Properties │ │ └── launchSettings.json │ ├── UapkiNet.csproj │ ├── UapkiNet.sln │ └── UapkiException.cs ├── Java │ ├── settings.gradle │ ├── gradle │ │ └── wrapper │ │ │ ├── gradle-wrapper.jar │ │ │ └── gradle-wrapper.properties │ ├── gradle.properties │ ├── .gitignore │ ├── src │ │ └── main │ │ │ └── java │ │ │ └── com │ │ │ └── sit │ │ │ └── uapki │ │ │ ├── method │ │ │ ├── Close.java │ │ │ ├── Deinit.java │ │ │ ├── GetCsr.java │ │ │ ├── DeleteKey.java │ │ │ ├── Keys.java │ │ │ ├── RemoveCert.java │ │ │ ├── Version.java │ │ │ ├── ChangePassword.java │ │ │ └── GetCert.java │ │ │ ├── crl │ │ │ ├── CrlCacheInfo.java │ │ │ └── CrlId.java │ │ │ ├── common │ │ │ ├── TspInfo.java │ │ │ ├── PkiData.java │ │ │ ├── PkiNumber.java │ │ │ ├── PkiOid.java │ │ │ ├── PkiTime.java │ │ │ ├── Document.java │ │ │ └── Attribute.java │ │ │ ├── key │ │ │ └── KeyId.java │ │ │ ├── cert │ │ │ ├── CertId.java │ │ │ ├── CertCacheInfo.java │ │ │ ├── Validity.java │ │ │ └── SubjectPublicKeyInfo.java │ │ │ └── UapkiException.java │ └── build.gradle ├── Browser │ └── manifest │ │ ├── uapki-hostapp-firefox.json │ │ ├── uapki-hostapp-chrome.json │ │ └── README.md └── Node.js │ └── napi │ ├── binding.gyp │ └── package.json ├── doc └── UAPKI-PM-2.0.12.pdf ├── AUTHORS ├── .gitignore └── LICENSE /library/test/data/.gitignore: -------------------------------------------------------------------------------- 1 | /new-key.p12 2 | -------------------------------------------------------------------------------- /integration/Net/.gitignore: -------------------------------------------------------------------------------- 1 | #ignore dirs 2 | .vs/ 3 | bin/ 4 | obj/ 5 | -------------------------------------------------------------------------------- /library/test/data/test-fox.txt: -------------------------------------------------------------------------------- 1 | The quick brown fox jumps over the lazy dog -------------------------------------------------------------------------------- /integration/Java/settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'uapki' 2 | include(':lib') -------------------------------------------------------------------------------- /doc/UAPKI-PM-2.0.12.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/doc/UAPKI-PM-2.0.12.pdf -------------------------------------------------------------------------------- /library/uapkic/Application-all.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | APP_PLATFORM := android-28 3 | APP_BUILD_SCRIPT := Android.mk -------------------------------------------------------------------------------- /library/uapkif/Application-all.mk: -------------------------------------------------------------------------------- 1 | APP_ABI := all 2 | APP_PLATFORM := android-28 3 | APP_BUILD_SCRIPT := Android.mk -------------------------------------------------------------------------------- /library/test/data/test-diia.p12: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/test/data/test-diia.p12 -------------------------------------------------------------------------------- /integration/Java/gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/integration/Java/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /library/common/curl/builds/windows_x86/libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/common/curl/builds/windows_x86/libcurl.lib -------------------------------------------------------------------------------- /library/test/data/certs/diia-test-kep-7775604.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/test/data/certs/diia-test-kep-7775604.cer -------------------------------------------------------------------------------- /library/test/data/certs/diia-test-sign-7775603.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/test/data/certs/diia-test-sign-7775603.cer -------------------------------------------------------------------------------- /library/common/curl/builds/windows_x86-64/libcurl.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/common/curl/builds/windows_x86-64/libcurl.lib -------------------------------------------------------------------------------- /library/test/data/certs/CAO-05E19E2CD92EA2990100000001000000C1000000.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/test/data/certs/CAO-05E19E2CD92EA2990100000001000000C1000000.cer -------------------------------------------------------------------------------- /library/test/data/certs/diia-CA-05E19E2CD92EA2990100000001000000E1000000.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/test/data/certs/diia-CA-05E19E2CD92EA2990100000001000000E1000000.cer -------------------------------------------------------------------------------- /library/test/data/certs/diia-ocsp-3ED5083160DBC59B0200000001000000202B0F00.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/test/data/certs/diia-ocsp-3ED5083160DBC59B0200000001000000202B0F00.cer -------------------------------------------------------------------------------- /library/test/data/certs/diia-2023-tsp-05E19E2CD92EA29902000000010000004A010000.cer: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/test/data/certs/diia-2023-tsp-05E19E2CD92EA29902000000010000004A010000.cer -------------------------------------------------------------------------------- /integration/Net/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "UapkiNet": { 4 | "commandName": "Project", 5 | "workingDirectory": "C:\\WORKSPACE\\pub\\UAPKI\\library\\build" 6 | } 7 | } 8 | } -------------------------------------------------------------------------------- /library/test/data/crls/BED5083160DBC59BCDDF707C10293F58BB6ED263C6EA5893D3781B61F493BE57-delta-0ABEA7.crl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/specinfo-ua/UAPKI/HEAD/library/test/data/crls/BED5083160DBC59BCDDF707C10293F58BB6ED263C6EA5893D3781B61F493BE57-delta-0ABEA7.crl -------------------------------------------------------------------------------- /integration/Browser/manifest/uapki-hostapp-firefox.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.sit.uapki.hostapp", 3 | "description": "UAPKI HostApp", 4 | "path": "D:/uapki/library/build/uapki-hostapp.exe", 5 | "type": "stdio", 6 | "allowed_extensions": [ "sign@sit.company" ] 7 | } -------------------------------------------------------------------------------- /integration/Java/gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Tue Jun 01 09:12:48 EEST 2021 2 | distributionBase=GRADLE_USER_HOME 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-bin.zip 4 | distributionPath=wrapper/dists 5 | zipStorePath=wrapper/dists 6 | zipStoreBase=GRADLE_USER_HOME 7 | -------------------------------------------------------------------------------- /library/build-uapki-x64.bat: -------------------------------------------------------------------------------- 1 | set DIR_ARCH=x64 2 | set DIR_BUILD=build 3 | 4 | mkdir %DIR_BUILD% 5 | cd %DIR_BUILD% 6 | del /f /s /q * 7 | mkdir out 8 | cd .. 9 | 10 | cmake -G "Visual Studio 16 2019" -A %DIR_ARCH% -S . -B %DIR_BUILD% 11 | pause 12 | 13 | cmake --build %DIR_BUILD% --config Release 14 | pause -------------------------------------------------------------------------------- /library/build-uapki-x86.bat: -------------------------------------------------------------------------------- 1 | set DIR_ARCH=Win32 2 | set DIR_BUILD=build 3 | 4 | mkdir %DIR_BUILD% 5 | cd %DIR_BUILD% 6 | del /f /s /q * 7 | mkdir out 8 | cd .. 9 | 10 | cmake -G "Visual Studio 16 2019" -A %DIR_ARCH% -S . -B %DIR_BUILD% 11 | pause 12 | 13 | cmake --build %DIR_BUILD% --config Release 14 | pause -------------------------------------------------------------------------------- /integration/Java/gradle.properties: -------------------------------------------------------------------------------- 1 | # Generally it is better to set the version only for release builds, build time 2 | # from command line using -Pversion=1.0.0 3 | # 4 | # Only use SNAPSHOT versions if you need to contribute your binaries to a 5 | # local Maven project. 6 | version=SNAPSHOT 7 | 8 | netbeans.license=bsd_1 9 | -------------------------------------------------------------------------------- /integration/Java/.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | .idea 3 | **/build/ 4 | **/build/resources 5 | !src/**/build/ 6 | 7 | # Ignore Gradle GUI config 8 | gradle-app.setting 9 | 10 | # Avoid ignoring Gradle wrapper jar file (.jar files are usually ignored) 11 | !gradle-wrapper.jar 12 | 13 | # Cache of project 14 | .gradletasknamecache 15 | -------------------------------------------------------------------------------- /integration/Browser/manifest/uapki-hostapp-chrome.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.sit.uapki.hostapp", 3 | "description": "UAPKI HostApp", 4 | "path": "D:/uapki/library/build/uapki-hostapp.exe", 5 | "type": "stdio", 6 | "allowed_origins": [ "chrome-extension://anepdhbldokfhnfgfkhgccchaiffbkfp/", "chrome-extension://ogicjmddlnadkbplokpfjlidbbemdokm/"] 7 | } -------------------------------------------------------------------------------- /integration/Node.js/napi/binding.gyp: -------------------------------------------------------------------------------- 1 | { 2 | "targets": [ 3 | { 4 | "cflags!": [ "-fno-exceptions" ], 5 | "cflags_cc!": [ "-fno-exceptions" ], 6 | "include_dirs" : [ 7 | " 5 | Roman Ponomarenko 6 | Dmytro Kovalevskyi 7 | Anton Savchenko 8 | Sviatoslav Komkov 9 | Vadim Shevchuk 10 | 11 | # BEGIN organizations section. 12 | S.I.T LLC 13 | SPECINFOSYSTEMS LLC 14 | Privatbank -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | -------------------------------------------------------------------------------- /library/hostapp/uapki-hostapp.vcxproj.filters: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | common\loaders 7 | 8 | 9 | 10 | 11 | {da660d79-ba38-481e-9540-82e0a296a035} 12 | 13 | 14 | {b336d2c5-3fc6-4f9f-8188-87cb414485c0} 15 | 16 | 17 | 18 | 19 | common\loaders 20 | 21 | 22 | common\loaders 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /integration/Net/UapkiNet.csproj: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Exe 5 | netcoreapp3.1 6 | AnyCPU;x64 7 | 8 | 9 | 10 | 11 | true 12 | 13 | 14 | 15 | true 16 | 17 | 18 | 19 | true 20 | 21 | 22 | 23 | true 24 | x64 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2016-2021, The UAPKI Authors. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /library/hostapp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.05) 2 | 3 | project(uapki-hostapp LANGUAGES C CXX) 4 | 5 | message(STATUS "Project: uapki-hostapp") 6 | 7 | if(NOT CMAKE_BUILD_TYPE) 8 | set(CMAKE_BUILD_TYPE "Release") 9 | message(STATUS "Build type not specified: Use Release by default") 10 | endif(NOT CMAKE_BUILD_TYPE) 11 | 12 | set(CMAKE_C_STANDARD 99) 13 | set(CMAKE_CXX_STANDARD 11) 14 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 15 | set(CMAKE_CXX_VISIBILITY_PRESET hidden) 16 | set(CMAKE_CXX_FLAGS_DEBUG_INIT "-Wall") 17 | set(CMAKE_CXX_FLAGS_RELEASE_INIT "-Wall") 18 | #set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") 19 | set(CMAKE_SKIP_RPATH ON) 20 | 21 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 22 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out) 23 | 24 | set(PATH_PRJ ${CMAKE_CURRENT_SOURCE_DIR}) 25 | set(PATH_COMMON_LOADERS ${PATH_PRJ}/../common/loaders) 26 | 27 | include_directories( 28 | ${PATH_COMMON_LOADERS} 29 | ) 30 | 31 | link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../out) 32 | 33 | add_executable (uapki-hostapp 34 | uapki-hostapp.cpp 35 | ${PATH_COMMON_LOADERS}/uapki-loader.cpp 36 | ) 37 | 38 | if(${UNIX}) 39 | target_link_libraries(uapki-hostapp PRIVATE dl) 40 | endif() 41 | 42 | 43 | add_custom_command(TARGET uapki-hostapp POST_BUILD 44 | COMMAND ${CMAKE_COMMAND} -E copy $ ../out/ 45 | COMMAND ${CMAKE_COMMAND} -E copy $ ../../${OUT_DIR}/ 46 | ) 47 | -------------------------------------------------------------------------------- /library/common/curl/include/curl/stdcheaders.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_STDCHEADERS_H 2 | #define CURLINC_STDCHEADERS_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | 27 | size_t fread(void *, size_t, size_t, FILE *); 28 | size_t fwrite(const void *, size_t, size_t, FILE *); 29 | 30 | int strcasecmp(const char *, const char *); 31 | int strncasecmp(const char *, const char *, size_t); 32 | 33 | #endif /* CURLINC_STDCHEADERS_H */ 34 | -------------------------------------------------------------------------------- /integration/Net/UapkiNet.sln: -------------------------------------------------------------------------------- 1 | 2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.5.33516.290 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UapkiNet", "UapkiNet.csproj", "{2EE7195A-9850-4038-8C87-EA36BD75193A}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Debug|x64 = Debug|x64 12 | Release|Any CPU = Release|Any CPU 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2EE7195A-9850-4038-8C87-EA36BD75193A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 17 | {2EE7195A-9850-4038-8C87-EA36BD75193A}.Debug|Any CPU.Build.0 = Debug|Any CPU 18 | {2EE7195A-9850-4038-8C87-EA36BD75193A}.Debug|x64.ActiveCfg = Debug|x64 19 | {2EE7195A-9850-4038-8C87-EA36BD75193A}.Debug|x64.Build.0 = Debug|x64 20 | {2EE7195A-9850-4038-8C87-EA36BD75193A}.Release|Any CPU.ActiveCfg = Release|Any CPU 21 | {2EE7195A-9850-4038-8C87-EA36BD75193A}.Release|Any CPU.Build.0 = Release|Any CPU 22 | {2EE7195A-9850-4038-8C87-EA36BD75193A}.Release|x64.ActiveCfg = Release|x64 23 | {2EE7195A-9850-4038-8C87-EA36BD75193A}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {8F5DF528-7B7C-4089-ACC7-0D77FE682141} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /library/test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.05) 2 | 3 | project(test LANGUAGES C CXX) 4 | 5 | message(STATUS "Project: test") 6 | 7 | if(NOT CMAKE_BUILD_TYPE) 8 | set(CMAKE_BUILD_TYPE "Release") 9 | message(STATUS "Build type not specified: Use Release by default") 10 | endif(NOT CMAKE_BUILD_TYPE) 11 | 12 | set(CMAKE_C_STANDARD 99) 13 | set(CMAKE_CXX_STANDARD 11) 14 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 15 | set(CMAKE_CXX_VISIBILITY_PRESET hidden) 16 | set(CMAKE_CXX_FLAGS_DEBUG_INIT "-Wall") 17 | set(CMAKE_CXX_FLAGS_RELEASE_INIT "-Wall") 18 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") 19 | #set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++") 20 | set(CMAKE_SKIP_RPATH ON) 21 | 22 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 23 | set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/out) 24 | 25 | set(PATH_PRJ ${CMAKE_CURRENT_SOURCE_DIR}) 26 | set(PATH_COMMON_LOADERS ${PATH_PRJ}/../common/loaders) 27 | set(PATH_COMMON_JSON ${PATH_PRJ}/../common/json) 28 | 29 | include_directories( 30 | ${PATH_COMMON_LOADERS} 31 | ${PATH_COMMON_JSON} 32 | ) 33 | 34 | link_directories(${CMAKE_CURRENT_SOURCE_DIR}/../out) 35 | 36 | add_executable (test 37 | test.cpp 38 | ${PATH_COMMON_LOADERS}/uapki-loader.cpp 39 | ${PATH_COMMON_JSON}/parson.c 40 | ${PATH_COMMON_JSON}/parson-helper.cpp 41 | ${PATH_COMMON_JSON}/strtod-no-locale.c 42 | ) 43 | 44 | if(${UNIX}) 45 | target_link_libraries(test PRIVATE dl) 46 | endif() 47 | 48 | 49 | add_custom_command(TARGET test POST_BUILD 50 | COMMAND ${CMAKE_COMMAND} -E copy $ ../out/ 51 | COMMAND ${CMAKE_COMMAND} -E copy $ ../../${OUT_DIR}/ 52 | ) 53 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/method/Close.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.method; 29 | 30 | /** 31 | * Classes for CLOSE-method 32 | */ 33 | public interface Close { 34 | static final String METHOD = "CLOSE"; 35 | } 36 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/method/Deinit.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.method; 29 | 30 | /** 31 | * Classes for DEINIT-method 32 | */ 33 | public interface Deinit { 34 | static final String METHOD = "DEINIT"; 35 | } 36 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/crl/CrlCacheInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.crl; 29 | 30 | public class CrlCacheInfo { 31 | int countCrls; 32 | 33 | public int getCountCrls() { 34 | return countCrls; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/common/TspInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.common; 29 | 30 | public class TspInfo { 31 | String url; 32 | String policy; 33 | 34 | public String getUrl() { 35 | return url; 36 | } 37 | public String getPolicy() { 38 | return policy; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /library/uapki/src/api/storage-close.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define FILE_MARKER "uapki/api/storage-close.cpp" 29 | 30 | #include "api-json-internal.h" 31 | 32 | 33 | int uapki_storage_close (JSON_Object* joParams, JSON_Object* joResult) 34 | { 35 | (void)joParams; 36 | (void)joResult; 37 | const int ret = CmProviders::storageClose(); 38 | return ret; 39 | } 40 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/key/KeyId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.key; 29 | 30 | public class KeyId { 31 | final String value; 32 | 33 | public KeyId (String certId) { 34 | this.value = certId; 35 | } 36 | 37 | @Override 38 | public String toString () { 39 | return value; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/crl/CrlId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.crl; 29 | 30 | public final class CrlId { 31 | final String value; 32 | 33 | public CrlId (String certId) { 34 | this.value = certId; 35 | } 36 | 37 | @Override 38 | public String toString () { 39 | return value; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/cert/CertId.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.cert; 29 | 30 | public final class CertId { 31 | final String value; 32 | 33 | public CertId (String certId) { 34 | this.value = certId; 35 | } 36 | 37 | @Override 38 | public String toString () { 39 | return value; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/common/PkiData.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.common; 29 | 30 | 31 | public class PkiData { 32 | final String value; 33 | 34 | public PkiData (String base64) { 35 | this.value = base64; 36 | } 37 | 38 | @Override 39 | public String toString () { 40 | return value; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/common/PkiNumber.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.common; 29 | 30 | 31 | public class PkiNumber { 32 | final String value; 33 | 34 | public PkiNumber (String id) { 35 | this.value = id; 36 | } 37 | 38 | @Override 39 | public String toString () { 40 | return value; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/common/PkiOid.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.common; 29 | 30 | 31 | public class PkiOid { 32 | final String value; 33 | 34 | public PkiOid (String strOid) { 35 | this.value = strOid; 36 | } 37 | 38 | @Override 39 | public String toString () { 40 | return value; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/common/PkiTime.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.common; 29 | 30 | 31 | public class PkiTime { 32 | final String value; 33 | 34 | public PkiTime (String strTime) { 35 | this.value = strTime; 36 | } 37 | 38 | @Override 39 | public String toString () { 40 | return value; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/cert/CertCacheInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.cert; 29 | 30 | public class CertCacheInfo { 31 | int countCerts; 32 | int countTrustedCerts; 33 | 34 | public int getCountCerts () { 35 | return countCerts; 36 | } 37 | 38 | public int getCountTrustedCerts () { 39 | return countTrustedCerts; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /library/uapkic/include/drbg.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKIC_DRBG_H 29 | #define UAPKIC_DRBG_H 30 | 31 | #include "byte-array.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | UAPKIC_EXPORT int drbg_random(ByteArray* random); 38 | UAPKIC_EXPORT int drbg_reseed(const ByteArray* entropy); 39 | 40 | UAPKIC_EXPORT int drbg_self_test(void); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /library/uapkic/Android.mk: -------------------------------------------------------------------------------- 1 | DIR_ROOT := ../../uapkic 2 | DIR_SRC := $(DIR_ROOT)/src 3 | 4 | LOCAL_PATH := $(abspath $(call my-dir)) 5 | include $(CLEAR_VARS) 6 | LOCAL_MODULE := uapkic 7 | LOCAL_CFLAGS := -DUAPKIC_LIBRARY 8 | #for support iconv will usage APP_PLATFORM := android-28 9 | 10 | LOCAL_C_INCLUDES += \ 11 | $(DIR_ROOT)/include \ 12 | $(DIR_SRC) 13 | 14 | LOCAL_SRC_FILES := \ 15 | $(DIR_SRC)/aes.c \ 16 | $(DIR_SRC)/byte-array.c \ 17 | $(DIR_SRC)/byte-array-internal.c \ 18 | $(DIR_SRC)/byte-utils-internal.c \ 19 | $(DIR_SRC)/des.c \ 20 | $(DIR_SRC)/drbg.c \ 21 | $(DIR_SRC)/dstu4145.c \ 22 | $(DIR_SRC)/dstu7564.c \ 23 | $(DIR_SRC)/dstu7624.c \ 24 | $(DIR_SRC)/dstu8845.c \ 25 | $(DIR_SRC)/ec.c \ 26 | $(DIR_SRC)/ecdsa.c \ 27 | $(DIR_SRC)/ecgdsa.c \ 28 | $(DIR_SRC)/eckcdsa.c \ 29 | $(DIR_SRC)/ecrdsa.c \ 30 | $(DIR_SRC)/ec-cache.c \ 31 | $(DIR_SRC)/ec-default-params.c \ 32 | $(DIR_SRC)/ec-internal.c \ 33 | $(DIR_SRC)/entropy.c \ 34 | $(DIR_SRC)/gost28147.c \ 35 | $(DIR_SRC)/gost34311.c \ 36 | $(DIR_SRC)/gostr3411-2012.c \ 37 | $(DIR_SRC)/hash.c \ 38 | $(DIR_SRC)/hmac.c \ 39 | $(DIR_SRC)/jitterentropy.c \ 40 | $(DIR_SRC)/keywrap.c \ 41 | $(DIR_SRC)/math-ec2m-internal.c \ 42 | $(DIR_SRC)/math-ecp-internal.c \ 43 | $(DIR_SRC)/math-ec-point-internal.c \ 44 | $(DIR_SRC)/math-ec-precomp-internal.c \ 45 | $(DIR_SRC)/math-gf2m-internal.c \ 46 | $(DIR_SRC)/math-gfp-internal.c \ 47 | $(DIR_SRC)/math-int-internal.c \ 48 | $(DIR_SRC)/md5.c \ 49 | $(DIR_SRC)/paddings.c \ 50 | $(DIR_SRC)/pbkdf.c \ 51 | $(DIR_SRC)/pthread-impl.c \ 52 | $(DIR_SRC)/ripemd.c \ 53 | $(DIR_SRC)/rsa.c \ 54 | $(DIR_SRC)/sha1.c \ 55 | $(DIR_SRC)/sha2.c \ 56 | $(DIR_SRC)/sha3.c \ 57 | $(DIR_SRC)/sm2dsa.c \ 58 | $(DIR_SRC)/sm3.c \ 59 | $(DIR_SRC)/stacktrace.c \ 60 | $(DIR_SRC)/uapkic.c \ 61 | $(DIR_SRC)/whirlpool.c \ 62 | $(DIR_SRC)/word-internal.c 63 | 64 | include $(BUILD_SHARED_LIBRARY) 65 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/cert/Validity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.cert; 29 | 30 | import com.sit.uapki.common.PkiTime; 31 | 32 | 33 | public class Validity { 34 | String notBefore; 35 | String notAfter; 36 | 37 | public PkiTime getNotBefore () { 38 | return new PkiTime(notBefore); 39 | } 40 | 41 | public PkiTime getNotAfter () { 42 | return new PkiTime(notAfter); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /library/common/pkix/dstu4145-params.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef CM_DSTU4145_PARAMS_H 29 | #define CM_DSTU4145_PARAMS_H 30 | 31 | #include "uapkic.h" 32 | #include "uapkif.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | int dstu4145_params_get_std_oid(const DSTUEllipticCurve_t* dstu_ec, char** curve); 39 | int dstu4145_params_get_ec(const AlgorithmIdentifier_t* aid, EcCtx** ec_ctx); 40 | 41 | #ifdef __cplusplus 42 | } 43 | #endif 44 | 45 | #endif -------------------------------------------------------------------------------- /integration/Java/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'java' 2 | apply plugin: 'jacoco' 3 | apply plugin: 'application' 4 | apply plugin: 'com.github.johnrengelman.shadow' 5 | apply plugin: 'maven-publish' 6 | 7 | description = 'UAPKI for Java' 8 | 9 | group = 'com.sit' 10 | archivesBaseName = 'uapki' 11 | version = findProperty('version') 12 | 13 | sourceCompatibility = 1.7 14 | targetCompatibility = 1.7 15 | 16 | mainClassName = 'com.sit.uapki.Library' 17 | 18 | repositories { 19 | mavenCentral() 20 | } 21 | 22 | dependencies { 23 | implementation 'com.google.code.gson:gson:2.8.8' 24 | implementation 'net.java.dev.jna:jna:5.9.0' 25 | implementation group: 'commons-io', name: 'commons-io', version: '2.6' //NOTE: 2.6 - last release for Java7, 2.7-2.11.x - required Java8 26 | testImplementation 'junit:junit:4.13' 27 | } 28 | 29 | jar { 30 | } 31 | 32 | task sourcesJar(type: Jar, dependsOn: classes) { 33 | archiveClassifier = 'sources' 34 | from sourceSets.main.allJava 35 | } 36 | 37 | task javadocJar(type: Jar, dependsOn: javadoc) { 38 | archiveClassifier = 'javadoc' 39 | from javadoc.destinationDir 40 | } 41 | 42 | buildscript { 43 | repositories { 44 | gradlePluginPortal() 45 | } 46 | dependencies { 47 | classpath 'gradle.plugin.com.github.jengelman.gradle.plugins:shadow:7.0.0' 48 | } 49 | } 50 | 51 | // You can publish with 52 | // ./gradlew -Pversion=$VERSION publish -Pmaven_repo=$MVN_URL -PrepoUsername=$MVN_USER -PrepoPassword=$MVN_PASS 53 | publishing { 54 | publications { 55 | mavenJava(MavenPublication) { 56 | from components.java 57 | artifact sourcesJar 58 | artifact javadocJar 59 | } 60 | } 61 | repositories { 62 | maven { 63 | name = "repo" 64 | url = findProperty("maven_repo") 65 | credentials(PasswordCredentials) 66 | } 67 | } 68 | } 69 | 70 | -------------------------------------------------------------------------------- /library/common/pkix/iconv-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKI_ICONV_UTILS_H 29 | #define UAPKI_ICONV_UTILS_H 30 | 31 | 32 | #include 33 | 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | 40 | char* utf8_to_cp1251 (const char * in); 41 | int utf8_to_utf16be (const char * in, unsigned char ** out, size_t * out_len); 42 | int utf16be_to_utf8 (const unsigned char * in, size_t in_len, char ** out); 43 | 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /library/common/cm-api/cm-export.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef CM_EXPORT_H 29 | #define CM_EXPORT_H 30 | 31 | #ifdef CM_LIBRARY 32 | #if defined(_MSC_VER) 33 | #define CM_EXPORT __declspec(dllexport) 34 | #else 35 | #define CM_EXPORT __attribute__((visibility("default"))) 36 | #endif 37 | #else 38 | #if defined(_MSC_VER) 39 | #define CM_EXPORT __declspec(dllimport) 40 | #else 41 | #define CM_EXPORT extern 42 | #endif 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/method/GetCsr.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.method; 29 | 30 | import com.sit.uapki.common.PkiData; 31 | 32 | /** 33 | * Classes for GET_CSR-method 34 | */ 35 | public interface GetCsr { 36 | static final String METHOD = "GET_CSR"; 37 | 38 | class Result { 39 | String bytes; 40 | 41 | public PkiData getBytes () { 42 | return new PkiData(bytes); 43 | } 44 | } // end class Result 45 | 46 | } 47 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/common/Document.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.common; 29 | 30 | 31 | public class Document { 32 | String id; 33 | String bytes; 34 | 35 | public Document (String id, PkiData bytes) { 36 | this.id = id; 37 | this.bytes = bytes.toString(); 38 | } 39 | 40 | public String getId () { 41 | return id; 42 | } 43 | 44 | public PkiData getBytes () { 45 | return new PkiData(bytes); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /library/uapkic/src/entropy-internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKIC_ENTROPY_INTERNAL_H 29 | #define UAPKIC_ENTROPY_INTERNAL_H 30 | 31 | #include "entropy.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | /** 38 | * Заповнює масив випадковими байтами відповідно методики генрації ключових даних. 39 | * 40 | * @param buf масив з випадковими байтами 41 | * @return код помилки 42 | */ 43 | int entropy_get(ByteArray **buf); 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/common/Attribute.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.common; 29 | 30 | public class Attribute { 31 | String type; 32 | String bytes; 33 | 34 | public Attribute (PkiOid type, PkiData bytes) { 35 | this.type = type.toString(); 36 | this.bytes = bytes.toString(); 37 | } 38 | 39 | public String getType () { 40 | return type; 41 | } 42 | 43 | public String getBytes () { 44 | return bytes; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/method/DeleteKey.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.method; 29 | 30 | import com.sit.uapki.key.KeyId; 31 | 32 | /** 33 | * Classes for DELETE_KEY-method 34 | */ 35 | public interface DeleteKey { 36 | static final String METHOD = "DELETE_KEY"; 37 | 38 | class Parameters { 39 | final String id; 40 | 41 | public Parameters (KeyId keyId) { 42 | this.id = keyId.toString(); 43 | } 44 | } // end class Parameters 45 | 46 | } 47 | -------------------------------------------------------------------------------- /library/uapki/src/api/provider-list-storages.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define FILE_MARKER "uapki/api/provider-list-storages.cpp" 29 | 30 | #include "api-json-internal.h" 31 | #include "parson-helper.h" 32 | 33 | 34 | int uapki_provider_list_storages (JSON_Object* joParams, JSON_Object* joResult) 35 | { 36 | const std::string s_providerid = ParsonHelper::jsonObjectGetString(joParams, "provider"); 37 | if (s_providerid.empty()) return RET_UAPKI_INVALID_PARAMETER; 38 | 39 | return CmProviders::listStorages(s_providerid, joResult); 40 | } 41 | -------------------------------------------------------------------------------- /library/uapkic/include/uapkic-export.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKIC_EXPORT_H 29 | #define UAPKIC_EXPORT_H 30 | 31 | #ifdef UAPKIC_LIBRARY 32 | #if defined(_MSC_VER) 33 | #define UAPKIC_EXPORT __declspec(dllexport) 34 | #else 35 | #define UAPKIC_EXPORT __attribute__((visibility("default"))) 36 | #endif 37 | #else 38 | #if defined(_MSC_VER) 39 | #define UAPKIC_EXPORT __declspec(dllimport) 40 | #else 41 | #define UAPKIC_EXPORT extern 42 | #endif 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /library/uapkif/include/uapkif-export.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKIF_EXPORT_H 29 | #define UAPKIF_EXPORT_H 30 | 31 | #ifdef UAPKIF_LIBRARY 32 | #if defined(_MSC_VER) 33 | #define UAPKIF_EXPORT __declspec(dllexport) 34 | #else 35 | #define UAPKIF_EXPORT __attribute__((visibility("default"))) 36 | #endif 37 | #else 38 | #if defined(_MSC_VER) 39 | #define UAPKIF_EXPORT __declspec(dllimport) 40 | #else 41 | #define UAPKIF_EXPORT extern 42 | #endif 43 | #endif 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/method/Keys.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.method; 29 | 30 | import com.sit.uapki.key.KeyInfo; 31 | import java.util.ArrayList; 32 | 33 | /** 34 | * Classes for KEYS-method 35 | */ 36 | public interface Keys { 37 | static final String METHOD = "KEYS"; 38 | 39 | class Result { 40 | private ArrayList keys; 41 | 42 | public ArrayList getKeys(){ 43 | return keys; 44 | } 45 | } // end class Result 46 | } 47 | -------------------------------------------------------------------------------- /library/uapki/src/api/library-deinit.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define FILE_MARKER "uapki/api/library-deinit.cpp" 29 | 30 | #include "api-json-internal.h" 31 | #include "global-objects.h" 32 | #include "http-helper.h" 33 | 34 | 35 | using namespace UapkiNS; 36 | 37 | 38 | int uapki_deinit (JSON_Object* joParams, JSON_Object* joResult) 39 | { 40 | (void)joParams; 41 | (void)joResult; 42 | 43 | release_config(); 44 | CmProviders::deinit(); 45 | release_stores(); 46 | HttpHelper::deinit(); 47 | 48 | return RET_OK; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /library/uapki/src/global-objects.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKI_GLOBAL_OBJECTS_H 29 | #define UAPKI_GLOBAL_OBJECTS_H 30 | 31 | 32 | #include "cer-store.h" 33 | #include "crl-store.h" 34 | #include "library-config.h" 35 | 36 | 37 | namespace UapkiNS { 38 | 39 | extern LibraryConfig* get_config (void); 40 | extern Cert::CerStore* get_cerstore (void); 41 | extern Crl::CrlStore* get_crlstore (void); 42 | 43 | extern void release_config (void); 44 | extern void release_stores (void); 45 | 46 | } // end namespace UapkiNS 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /library/uapkif/include/T61String.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2004 Lev Walkin . All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _T61String_H_ 30 | #define _T61String_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t T61String_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t T61String_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_T61String_desc(void); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /library/uapki/src/verify-status.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "verify-status.h" 29 | 30 | 31 | namespace UapkiNS { 32 | 33 | 34 | const char* verifyStatusToStr ( 35 | const VerifyStatus status 36 | ) 37 | { 38 | static const char* VERIFY_STATUS_STRINGS[6] = { 39 | "UNDEFINED", 40 | "NOT PRESENT", 41 | "INDETERMINATE", 42 | "FAILED", 43 | "INVALID", 44 | "VALID" 45 | }; 46 | return VERIFY_STATUS_STRINGS[((uint32_t)status < 6) ? (uint32_t)status : 0]; 47 | } 48 | 49 | 50 | } // end namespace UapkiNS 51 | -------------------------------------------------------------------------------- /library/uapkif/include/GeneralString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _GeneralString_H_ 30 | #define _GeneralString_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t GeneralString_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t GeneralString_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_GeneralString_desc(void); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /library/uapkif/include/TeletexString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _TeletexString_H_ 30 | #define _TeletexString_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t TeletexString_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t TeletexString_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_TeletexString_desc(void); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/method/RemoveCert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.method; 29 | 30 | import com.sit.uapki.cert.CertId; 31 | 32 | /** 33 | * Classes for REMOVE_CERT-method 34 | */ 35 | public interface RemoveCert { 36 | static final String METHOD = "REMOVE_CERT"; 37 | 38 | class Parameters { 39 | final String certId; 40 | 41 | public Parameters (CertId certId) { 42 | this.certId = certId.toString(); 43 | } 44 | } // end class Parameters 45 | 46 | // 47 | } 48 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/method/Version.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.method; 29 | 30 | /** 31 | * Classes for VERSION-method 32 | */ 33 | public interface Version { 34 | static final String METHOD = "VERSION"; 35 | 36 | class Result { 37 | String name; 38 | String version; 39 | 40 | public String getName () { 41 | return name; 42 | } 43 | 44 | public String getVersion () { 45 | return version; 46 | } 47 | } // end class Result 48 | 49 | } 50 | -------------------------------------------------------------------------------- /library/uapkif/include/GraphicString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2004 Lev Walkin . All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _GraphicString_H_ 30 | #define _GraphicString_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t GraphicString_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t GraphicString_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_GraphicString_desc(void); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /library/uapki/src/api/library-version.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define FILE_MARKER "uapki/api/library-version.cpp" 29 | 30 | #include "api-json-internal.h" 31 | 32 | 33 | static const char* LIB_NAME = "UAPKI"; 34 | static const char* LIB_VERSION = "2.0.12"; 35 | 36 | 37 | int uapki_version (JSON_Object* joParams, JSON_Object* joResult) 38 | { 39 | (void)joParams; 40 | int ret = RET_OK; 41 | 42 | DO_JSON(json_object_set_string(joResult, "name", LIB_NAME)); 43 | DO_JSON(json_object_set_string(joResult, "version", LIB_VERSION)); 44 | 45 | cleanup: 46 | return ret; 47 | } 48 | -------------------------------------------------------------------------------- /library/uapkif/include/ObjectDescriptor.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _ObjectDescriptor_H_ 30 | #define _ObjectDescriptor_H_ 31 | 32 | #include "GraphicString.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef GraphicString_t ObjectDescriptor_t; /* Implemented via GraphicString */ 39 | 40 | extern asn_TYPE_descriptor_t ObjectDescriptor_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_asn_ObjectDescriptor_desc(void); 42 | 43 | #ifdef __cplusplus 44 | } 45 | #endif 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /library/uapkif/include/ISO646String.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2004 Lev Walkin . All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _ISO646String_H_ 30 | #define _ISO646String_H_ 31 | 32 | #include "asn_application.h" 33 | #include "VisibleString.h" 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | typedef VisibleString_t ISO646String_t; /* Implemented using VisibleString */ 40 | 41 | extern asn_TYPE_descriptor_t ISO646String_desc; 42 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_ISO646String_desc(void); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/cert/SubjectPublicKeyInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.cert; 29 | 30 | import com.sit.uapki.common.PkiData; 31 | 32 | 33 | public class SubjectPublicKeyInfo { 34 | String algorithm; 35 | String parameters; 36 | String publicKey; 37 | 38 | public String getAlgorithm () { 39 | return algorithm; 40 | } 41 | 42 | public PkiData getParameters () { 43 | return new PkiData(parameters); 44 | } 45 | 46 | public PkiData getPublicKey () { 47 | return new PkiData(publicKey); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /library/common/pkix/aid.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKI_AID_H 29 | #define UAPKI_AID_H 30 | 31 | #include "uapkif.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | int aid_create_dstu4145_default(const char* alg, const char* curve, AlgorithmIdentifier_t** out); 38 | int aid_create_ec_default(const char* alg, const char* curve, AlgorithmIdentifier_t** out); 39 | int aid_create_rsa(AlgorithmIdentifier_t** out); 40 | int aid_gost28147_get_iv_and_sbox(const AlgorithmIdentifier_t* aid, ByteArray** iv, ByteArray** sbox); 41 | 42 | #ifdef __cplusplus 43 | } 44 | #endif 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /library/uapkif/include/NumericString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _NumericString_H_ 30 | #define _NumericString_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t NumericString_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t NumericString_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_NumericString_desc(void); 42 | 43 | asn_constr_check_f NumericString_constraint; 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /library/uapkif/include/VisibleString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _VisibleString_H_ 30 | #define _VisibleString_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t VisibleString_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t VisibleString_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_VisibleString_desc(void); 42 | 43 | asn_constr_check_f VisibleString_constraint; 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/method/ChangePassword.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.method; 29 | 30 | /** 31 | * Classes for CHANGE_PASSWORD-method 32 | */ 33 | public interface ChangePassword { 34 | static final String METHOD = "CHANGE_PASSWORD"; 35 | 36 | class Parameters { 37 | final String password; 38 | final String newPassword; 39 | 40 | public Parameters (String password, String newPassword) { 41 | this.password = password; 42 | this.newPassword = newPassword; 43 | } 44 | } // end class Parameters 45 | 46 | } 47 | -------------------------------------------------------------------------------- /library/uapkif/include/PrintableString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _PrintableString_H_ 30 | #define _PrintableString_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t PrintableString_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t PrintableString_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_PrintableString_desc(void); 42 | 43 | asn_constr_check_f PrintableString_constraint; 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/UapkiException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki; 29 | 30 | public class UapkiException extends Exception { 31 | private final int errorCode; 32 | private final String method; 33 | 34 | public UapkiException (String errorMessage, int errorCode, String method) { 35 | super(errorMessage); 36 | this.errorCode = errorCode; 37 | this.method = method; 38 | } 39 | 40 | public int getErrorCode () { 41 | return errorCode; 42 | } 43 | 44 | public String getMethod () { 45 | return method; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /library/uapkif/include/ENUMERATED.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _ENUMERATED_H_ 30 | #define _ENUMERATED_H_ 31 | 32 | #include "INTEGER.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef INTEGER_t ENUMERATED_t; /* Implemented via INTEGER */ 39 | 40 | extern asn_TYPE_descriptor_t ENUMERATED_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_ENUMERATED_desc(void); 42 | 43 | per_type_decoder_f ENUMERATED_decode_uper; 44 | per_type_encoder_f ENUMERATED_encode_uper; 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /library/uapkif/include/UTCTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023, The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _UTC_TIME_H_ 30 | #define _UTC_TIME_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t UTCTime_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t UTCTime_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t* get_UTCTime_desc(void); 42 | 43 | asn_struct_print_f UTCTime_print; 44 | asn_constr_check_f UTCTime_constraint; 45 | xer_type_encoder_f UTCTime_encode_xer; 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /integration/Net/UapkiException.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | using System; 29 | 30 | namespace UapkiLibrary 31 | { 32 | [Serializable] 33 | public class UapkiException : Exception 34 | { 35 | public UapkiException() 36 | { 37 | } 38 | 39 | public UapkiException(int error) 40 | : base("Помилка криптобібліотеки (код помилки " + error.ToString("X") + ")") 41 | { 42 | } 43 | 44 | public UapkiException(int error, Exception inner) 45 | : base("Помилка криптобібліотеки (код помилки " + error.ToString("X") + ")", inner) 46 | { 47 | } 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /library/uapkif/include/IA5String.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2004 Lev Walkin . All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _IA5String_H_ 30 | #define _IA5String_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t IA5String_t; /* Implemented via OCTET STRING */ 39 | 40 | /* 41 | * IA5String ASN.1 type definition. 42 | */ 43 | extern asn_TYPE_descriptor_t IA5String_desc; 44 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_IA5String_desc(void); 45 | 46 | asn_constr_check_f IA5String_constraint; 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /library/uapkif/include/asn1-errors.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2016 PrivatBank IT 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef UAPKIF_ASN1_ERRORS_H 30 | #define UAPKIF_ASN1_ERRORS_H 31 | 32 | #include "uapkic-errors.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | #define RET_ASN1_ERROR 100 39 | /** Ошибка кодирования в байты. */ 40 | #define RET_ASN1_ENCODE_ERROR 101 41 | /** Ошибка декодирования из байт. */ 42 | #define RET_ASN1_DECODE_ERROR 102 43 | #define RET_ASN1_TIME_ERROR 103 44 | 45 | #ifdef __cplusplus 46 | } 47 | #endif 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /library/uapki/src/api/provider-storage-info.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define FILE_MARKER "uapki/api/provider-storage-info.cpp" 29 | 30 | #include "api-json-internal.h" 31 | #include "parson-helper.h" 32 | 33 | 34 | int uapki_provider_storage_info (JSON_Object* joParams, JSON_Object* joResult) 35 | { 36 | const std::string s_providerid = ParsonHelper::jsonObjectGetString(joParams, "provider"); 37 | const std::string s_storageid = ParsonHelper::jsonObjectGetString(joParams, "storage"); 38 | if (s_providerid.empty() || s_storageid.empty()) return RET_UAPKI_INVALID_PARAMETER; 39 | 40 | return CmProviders::storageInfo(s_providerid, s_storageid, joResult); 41 | } 42 | -------------------------------------------------------------------------------- /library/uapki/src/api/storage-change-password.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define FILE_MARKER "uapki/api/storage-change-password.cpp" 29 | 30 | #include "api-json-internal.h" 31 | #include "cm-providers.h" 32 | 33 | 34 | int uapki_storage_change_password (JSON_Object* joParams, JSON_Object* joResult) 35 | { 36 | const char* s_newpassword = json_object_get_string(joParams, "newPassword"); 37 | if (!s_newpassword) return RET_UAPKI_INVALID_PARAMETER; 38 | 39 | CmStorageProxy* storage = CmProviders::openedStorage(); 40 | if (!storage) return RET_UAPKI_STORAGE_NOT_OPEN; 41 | 42 | const int ret = storage->sessionChangePassword(s_newpassword); 43 | return ret; 44 | } -------------------------------------------------------------------------------- /library/cm-pkcs12/src/storage/jks-utils.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef JKS_UTILS_H 29 | #define JKS_UTILS_H 30 | 31 | 32 | #include "byte-array.h" 33 | #include "jks-buffer.h" 34 | #include "uapkic.h" 35 | #include "uapkif.h" 36 | 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | 43 | int jks_read_header (JksBufferCtx* buffer, uint32_t* version, uint32_t* countEntries); 44 | int jks_hash_store (const char* password, const ByteArray* data, ByteArray** hash); 45 | int jks_decrypt_key (const EncryptedPrivateKeyInfo_t* container, const char* pass, ByteArray** key); 46 | 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /library/uapkif/include/GeneralizedTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023, The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _GENERALIZED_TIME_H_ 30 | #define _GENERALIZED_TIME_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t GeneralizedTime_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t GeneralizedTime_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t* get_GeneralizedTime_desc(void); 42 | 43 | asn_struct_print_f GeneralizedTime_print; 44 | asn_constr_check_f GeneralizedTime_constraint; 45 | xer_type_encoder_f GeneralizedTime_encode_xer; 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /library/uapkif/include/BMPString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2004 Lev Walkin . All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _BMPString_H_ 30 | #define _BMPString_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t BMPString_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t BMPString_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_BMPString_desc(void); 42 | 43 | asn_struct_print_f BMPString_print; /* Human-readable output */ 44 | xer_type_decoder_f BMPString_decode_xer; 45 | xer_type_encoder_f BMPString_encode_xer; 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /library/cm-pkcs12/src/cm-pkcs12-ctx.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef CM_PKCS12_CTX_H 29 | #define CM_PKCS12_CTX_H 30 | 31 | 32 | #include "cm-api.h" 33 | #include "file-storage.h" 34 | #include "uapkic.h" 35 | #include "uapki-ns.h" 36 | 37 | 38 | struct SessionPkcs12Context { 39 | CM_KEY_API keyApi; 40 | FileStorage fileStorage; 41 | // Data for sign-init/update/final 42 | StoreBag* activeBag; 43 | HashCtx* ctxHash; 44 | HashAlg hashAlgo; 45 | UapkiNS::AlgorithmIdentifier 46 | aidSignAlgo; 47 | 48 | SessionPkcs12Context (void); 49 | ~SessionPkcs12Context (void); 50 | 51 | void resetSignLong (void); 52 | 53 | }; // end struct SessionPkcs12Context 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /library/uapki/src/verify-status.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKI_VERIFY_STATUS_H 29 | #define UAPKI_VERIFY_STATUS_H 30 | 31 | 32 | #include "uapki-ns.h" 33 | 34 | 35 | namespace UapkiNS { 36 | 37 | 38 | enum class VerifyStatus : uint32_t { 39 | UNDEFINED = 0, 40 | NOT_PRESENT = 1, 41 | INDETERMINATE = 2, 42 | FAILED = 3, 43 | INVALID = 4, 44 | VALID = 5 45 | }; // end enum VerifyStatus 46 | 47 | typedef VerifyStatus DataVerifyStatus; 48 | typedef VerifyStatus DigestVerifyStatus; 49 | typedef VerifyStatus SignatureVerifyStatus; 50 | 51 | const char* verifyStatusToStr ( 52 | const VerifyStatus status 53 | ); 54 | 55 | 56 | } // end namespace UapkiNS 57 | 58 | 59 | #endif 60 | -------------------------------------------------------------------------------- /library/uapkif/include/UniversalString.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _UniversalString_H_ 30 | #define _UniversalString_H_ 31 | 32 | #include "OCTET_STRING.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef OCTET_STRING_t UniversalString_t; /* Implemented via OCTET STRING */ 39 | 40 | extern asn_TYPE_descriptor_t UniversalString_desc; 41 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_UniversalString_desc(void); 42 | 43 | asn_struct_print_f UniversalString_print; /* Human-readable output */ 44 | xer_type_decoder_f UniversalString_decode_xer; 45 | xer_type_encoder_f UniversalString_encode_xer; 46 | 47 | #ifdef __cplusplus 48 | } 49 | #endif 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /library/uapkif/include/IITParams.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _IITParams_H_ 30 | #define _IITParams_H_ 31 | 32 | #include "asn_application.h" 33 | #include "OCTET_STRING.h" 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* IITParams */ 40 | typedef struct IITParams { 41 | OCTET_STRING_t mac; 42 | OCTET_STRING_t aux; 43 | 44 | /* Context for parsing across buffer boundaries */ 45 | asn_struct_ctx_t _asn_ctx; 46 | } IITParams_t; 47 | 48 | /* Implementation */ 49 | extern asn_TYPE_descriptor_t IITParams_desc; 50 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_IITParams_desc(void); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /library/uapki/src/api/session-key-delete.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define FILE_MARKER "uapki/api/session-key-delete.cpp" 29 | 30 | #include "api-json-internal.h" 31 | #include "cm-providers.h" 32 | #include "uapki-ns.h" 33 | 34 | 35 | int uapki_session_key_delete (JSON_Object* joParams, JSON_Object* joResult) 36 | { 37 | (void)joResult; 38 | if (!joParams) return RET_UAPKI_INVALID_PARAMETER; 39 | 40 | CmStorageProxy* storage = CmProviders::openedStorage(); 41 | if (!storage) return RET_UAPKI_STORAGE_NOT_OPEN; 42 | 43 | UapkiNS::SmartBA sba_keyid; 44 | if (!sba_keyid.set(json_object_get_hex(joParams, "id"))) return RET_UAPKI_INVALID_PARAMETER; 45 | 46 | const int ret = storage->sessionDeleteKey(sba_keyid.get(), false); 47 | return ret; 48 | } 49 | -------------------------------------------------------------------------------- /library/uapkif/include/per_opentype.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2004 Lev Walkin . All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _PER_OPENTYPE_H_ 30 | #define _PER_OPENTYPE_H_ 31 | 32 | #ifdef __cplusplus 33 | extern "C" { 34 | #endif 35 | 36 | UAPKIF_EXPORT asn_dec_rval_t uper_open_type_get(asn_codec_ctx_t *opt_codec_ctx, asn_TYPE_descriptor_t *td, 37 | asn_per_constraints_t *constraints, void **sptr, asn_per_data_t *pd); 38 | 39 | UAPKIF_EXPORT int uper_open_type_skip(asn_codec_ctx_t *opt_codec_ctx, asn_per_data_t *pd); 40 | 41 | UAPKIF_EXPORT int uper_open_type_put(asn_TYPE_descriptor_t *td, asn_per_constraints_t *constraints, void *sptr, 42 | asn_per_outp_t *po); 43 | 44 | #ifdef __cplusplus 45 | } 46 | #endif 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /integration/Browser/manifest/README.md: -------------------------------------------------------------------------------- 1 | # Change "path" in *.json files to actual absolute path to uapki-hostapp. 2 | 3 | 4 | # On WINDOWS add path to manifest to registry (system-wide): 5 | Google Chrome: HKLM\Software\Google\Chrome\NativeMessagingHosts\com.sit.uapki.hostapp; ValueType: string; ValueData: "{path}\uapki-hostapp-chrome.json" 6 | 7 | Firefox: HKLM\Software\Mozilla\NativeMessagingHosts\com.sit.uapki.hostapp; ValueType: string; ValueData: "{path}\uapki-hostapp-firefox.json" 8 | 9 | 10 | # On WINDOWS add path to manifest to registry (user-specific): 11 | Google Chrome: HKCU\Software\Google\Chrome\NativeMessagingHosts\com.sit.uapki.hostapp; ValueType: string; ValueData: "{path}\uapki-hostapp-chrome.json" 12 | 13 | Firefox: HKCU\Software\Mozilla\NativeMessagingHosts\com.sit.uapki.hostapp; ValueType: string; ValueData: "{path}\uapki-hostapp-firefox.json" 14 | 15 | 16 | # On Linux (system-wide): 17 | Google Chrome: /etc/opt/chrome/native-messaging-hosts/uapki-hostapp-chrome.json 18 | 19 | Chromium: /etc/chromium/native-messaging-hosts/uapki-hostapp-chrome.json 20 | 21 | Firefox: /usr/lib/mozilla/native-messaging-hosts/uapki-hostapp-firefox.json or /usr/lib64/mozilla/native-messaging-hosts/uapki-hostapp-firefox.json 22 | 23 | # On Linux (user-specific, default path): 24 | Google Chrome: ~/.config/google-chrome/NativeMessagingHosts/uapki-hostapp-chrome.json 25 | 26 | Chromium: ~/.config/chromium/NativeMessagingHosts/uapki-hostapp-chrome.json 27 | 28 | Firefox: ~/.mozilla/native-messaging-hosts/uapki-hostapp-firefox.json 29 | 30 | # On macOS (system-wide): 31 | Google Chrome: /Library/Google/Chrome/NativeMessagingHosts/uapki-hostapp-chrome.json 32 | 33 | Chromium: /Library/Google/Chrome/NativeMessagingHosts/uapki-hostapp-chrome.json 34 | 35 | Firefox: /Library/Application Support/Mozilla/NativeMessagingHosts/uapki-hostapp-firefox.json 36 | 37 | # On macOS (user-specific, default path): 38 | Google Chrome: ~/Library/Application Support/Google/Chrome/NativeMessagingHosts/uapki-hostapp-chrome.json 39 | 40 | Chromium: ~/Library/Application Support/Chromium/NativeMessagingHosts/uapki-hostapp-chrome.json 41 | 42 | Firefox: ~/Library/Application Support/Mozilla/NativeMessagingHosts/uapki-hostapp-firefox.json 43 | -------------------------------------------------------------------------------- /integration/Java/src/main/java/com/sit/uapki/method/GetCert.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | package com.sit.uapki.method; 29 | 30 | import com.sit.uapki.cert.CertId; 31 | import com.sit.uapki.common.PkiData; 32 | 33 | /** 34 | * Classes for GET_CERT-method 35 | */ 36 | public interface GetCert { 37 | static final String METHOD = "GET_CERT"; 38 | 39 | class Parameters { 40 | final String certId; 41 | 42 | public Parameters (CertId certId) { 43 | this.certId = certId.toString(); 44 | } 45 | } // end class Parameters 46 | 47 | class Result { 48 | String bytes; 49 | 50 | public PkiData getBytes() { 51 | return new PkiData(bytes); 52 | } 53 | } // end class Result 54 | 55 | } 56 | -------------------------------------------------------------------------------- /library/uapkif/include/RSAPublicKey.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _RSAPublicKey_H_ 30 | #define _RSAPublicKey_H_ 31 | 32 | #include "asn_application.h" 33 | #include "INTEGER.h" 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* RSAPublicKey */ 40 | typedef struct RSAPublicKey { 41 | INTEGER_t modulus; 42 | INTEGER_t publicExponent; 43 | 44 | /* Context for parsing across buffer boundaries */ 45 | asn_struct_ctx_t _asn_ctx; 46 | } RSAPublicKey_t; 47 | 48 | /* Implementation */ 49 | extern asn_TYPE_descriptor_t RSAPublicKey_desc; 50 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_RSAPublicKey_desc(void); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /library/hostapp/uapki-hostapp-debug.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2022, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKI_HOSTAPP_DEBUG_H 29 | #define UAPKI_HOSTAPP_DEBUG_H 30 | 31 | 32 | #include 33 | #include 34 | 35 | 36 | #define DEBUG_OUTSTREAM_FILENAME "uapki-hostapp.log" 37 | 38 | #define DEBUG_OUTPUT_FUNC \ 39 | static void debug_output (const std::string& msg) \ 40 | { \ 41 | FILE* f = fopen(DEBUG_OUTSTREAM_FILENAME, "a"); \ 42 | if (!f) return; \ 43 | const std::string s_msg = msg + std::string("\n"); \ 44 | fputs(s_msg.c_str(), f); \ 45 | if (f != stdout) fclose(f); \ 46 | } 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /library/uapki/include/uapki-export.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKI_EXPORT_H 29 | #define UAPKI_EXPORT_H 30 | 31 | #define UAPKI_VERSION 1000 32 | 33 | 34 | #ifdef UAPKI_LIBRARY 35 | #if defined(_MSC_VER) 36 | #define UAPKI_EXPORT __declspec(dllexport) 37 | #else 38 | #define UAPKI_EXPORT __attribute__((visibility("default"))) 39 | #endif 40 | #else 41 | #if defined(_MSC_VER) 42 | #define UAPKI_EXPORT __declspec(dllimport) 43 | #else 44 | #define UAPKI_EXPORT extern 45 | #endif 46 | #endif 47 | 48 | 49 | #ifdef __cplusplus 50 | extern "C" { 51 | #endif 52 | 53 | 54 | UAPKI_EXPORT char* process(const char* request); 55 | UAPKI_EXPORT void json_free(char* buf); 56 | 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /library/uapki/src/dirent-internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef _DIRENT_COMMON_H_ 29 | #define _DIRENT_COMMON_H_ 30 | 31 | #include 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | #if defined _WIN32 38 | 39 | typedef struct DIR DIR; 40 | 41 | struct dirent { 42 | char *d_name; 43 | }; 44 | 45 | DIR *opendir(const char *); 46 | int closedir(DIR *); 47 | struct dirent *readdir(DIR *); 48 | void rewinddir(DIR *); 49 | 50 | bool is_dir(const char* path); 51 | 52 | #else 53 | # ifdef __unix__ 54 | # define _INCLUDE_POSIX_SOURCE 55 | # endif /* __unix__ */ 56 | # include 57 | bool is_dir(const char* path); 58 | #endif /* _WIN32 */ 59 | 60 | #ifdef __cplusplus 61 | } 62 | #endif 63 | 64 | #endif /* _DIRENT_COMMON_H_ */ 65 | -------------------------------------------------------------------------------- /library/uapkic/include/pbkdf.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2016 PrivatBank IT 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef UAPKIC_PBKDF_H 30 | #define UAPKIC_PBKDF_H 31 | 32 | #include "hash.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | UAPKIC_EXPORT int pbkdf1(const char* pass, const ByteArray* salt, uint8_t id, size_t iter, size_t n, HashAlg hash_alg, ByteArray** key); 39 | 40 | UAPKIC_EXPORT int pbkdf2(const char* pass, const ByteArray* salt, size_t iterations, size_t key_len, HashAlg hash_alg, ByteArray** key); 41 | 42 | /** 43 | * Виконує самотестування реалізації алгоритму . 44 | * 45 | * @return код помилки або RET_OK, якщо самотестування пройдено 46 | */ 47 | UAPKIC_EXPORT int pbkdf_self_test(void); 48 | 49 | #ifdef __cplusplus 50 | } 51 | #endif 52 | 53 | #endif 54 | -------------------------------------------------------------------------------- /library/uapkic/include/paddings.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2016 PrivatBank IT 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef UAPKIC_PADDINGS_H 30 | #define UAPKIC_PADDINGS_H 31 | 32 | #include "byte-array.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | UAPKIC_EXPORT int make_pkcs7_padding(const ByteArray *data, uint8_t block_len, ByteArray **data_with_padding); 39 | 40 | UAPKIC_EXPORT int make_pkcs7_unpadding(const ByteArray *data_with_padding, ByteArray **data_without_padding); 41 | 42 | UAPKIC_EXPORT int make_iso_7816_4_padding(const ByteArray *data, uint8_t block_len, ByteArray **data_with_padding); 43 | 44 | UAPKIC_EXPORT int make_iso_7816_4_unpadding(const ByteArray *data_with_padding, ByteArray **data_without_padding); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /library/common/pkix/dstu-ns.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKI_DSTU_NS_H 29 | #define UAPKI_DSTU_NS_H 30 | 31 | 32 | #include "byte-array.h" 33 | #include "uapkif.h" 34 | #include 35 | 36 | 37 | namespace DstuNS { 38 | 39 | int ba2BitStringEncapOctet (const ByteArray* baData, BIT_STRING_t* bsEncapOctet); 40 | int calcKeyId (const ByteArray* baPubkey, ByteArray** baKeyId); 41 | bool isDstu4145family (const char* algo); 42 | bool isDstu4145family (const std::string& algo); 43 | 44 | namespace Dstu4145 { 45 | int decodeParams (const ByteArray* baEncoded, std::string& oidNamedCurve); 46 | int encodeParams (const std::string& oidNamedCurve, const ByteArray* baDKE, ByteArray** baEncoded); 47 | 48 | } // end namespace Dstu4145 49 | 50 | } // end namespace DstuNS 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /library/uapki/src/api/library-list-providers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #define FILE_MARKER "uapki/api/library-list-providers.cpp" 29 | 30 | #include "api-json-internal.h" 31 | 32 | 33 | int uapki_list_providers (JSON_Object* joParams, JSON_Object* joResult) 34 | { 35 | (void)joParams; 36 | int ret = RET_OK; 37 | JSON_Array* ja_providers = NULL; 38 | const size_t count = CmProviders::count(); 39 | 40 | DO_JSON(json_object_set_value(joResult, "providers", json_value_init_array())); 41 | ja_providers = json_object_get_array(joResult, "providers"); 42 | for (size_t i = 0; i < count; i++) { 43 | DO_JSON(json_array_append_value(ja_providers, json_value_init_object())); 44 | DO(CmProviders::getInfo(i, json_array_get_object(ja_providers, i))); 45 | } 46 | 47 | cleanup: 48 | return ret; 49 | } 50 | -------------------------------------------------------------------------------- /library/uapkif/include/OtherPrimeInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _OtherPrimeInfo_H_ 30 | #define _OtherPrimeInfo_H_ 31 | 32 | #include "asn_application.h" 33 | #include "INTEGER.h" 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* OtherPrimeInfo */ 40 | typedef struct OtherPrimeInfo { 41 | INTEGER_t prime; 42 | INTEGER_t exponent; 43 | INTEGER_t coefficient; 44 | 45 | /* Context for parsing across buffer boundaries */ 46 | asn_struct_ctx_t _asn_ctx; 47 | } OtherPrimeInfo_t; 48 | 49 | /* Implementation */ 50 | extern asn_TYPE_descriptor_t OtherPrimeInfo_desc; 51 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_OtherPrimeInfo_desc(void); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /library/uapkif/include/Validity.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _Validity_H_ 30 | #define _Validity_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "PKIXTime.h" 37 | #include "constr_SEQUENCE.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /* Validity */ 44 | typedef struct Validity { 45 | PKIXTime_t notBefore; 46 | PKIXTime_t notAfter; 47 | 48 | /* Context for parsing across buffer boundaries */ 49 | asn_struct_ctx_t _asn_ctx; 50 | } Validity_t; 51 | 52 | /* Implementation */ 53 | extern asn_TYPE_descriptor_t Validity_desc; 54 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_Validity_desc(void); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /library/uapkic/include/dstu8845.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKIC_DSTU8845_H 29 | #define UAPKIC_DSTU8845_H 30 | 31 | #include "byte-array.h" 32 | 33 | #ifdef __cplusplus 34 | extern "C" { 35 | #endif 36 | 37 | typedef struct Dstu8845Ctx_st Dstu8845Ctx; 38 | 39 | UAPKIC_EXPORT Dstu8845Ctx *dstu8845_alloc(void); 40 | 41 | UAPKIC_EXPORT int dstu8845_init(Dstu8845Ctx *ctx, const ByteArray* key, const ByteArray* iv); 42 | 43 | UAPKIC_EXPORT int dstu8845_set_iv(Dstu8845Ctx *ctx, const ByteArray* iv); 44 | 45 | UAPKIC_EXPORT int dstu8845_crypt(Dstu8845Ctx *ctx, ByteArray* inout); 46 | 47 | UAPKIC_EXPORT void dstu8845_free(Dstu8845Ctx *ctx); 48 | 49 | UAPKIC_EXPORT int dstu8845_generate_key(size_t key_len, ByteArray** key); 50 | 51 | UAPKIC_EXPORT int dstu8845_self_test(void); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /library/uapkif/include/GOST34310Sign.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _GOST34310Sign_H_ 30 | #define _GOST34310Sign_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "INTEGER.h" 37 | #include "constr_SEQUENCE.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /* GOST34310Sign */ 44 | typedef struct GOST34310Sign { 45 | INTEGER_t r; 46 | INTEGER_t s; 47 | 48 | /* Context for parsing across buffer boundaries */ 49 | asn_struct_ctx_t _asn_ctx; 50 | } GOST34310Sign_t; 51 | 52 | /* Implementation */ 53 | extern asn_TYPE_descriptor_t GOST34310Sign_desc; 54 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_GOST34310Sign_desc(void); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /library/uapkif/include/SequenceOfANY.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2023, The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _SEQUENCE_OF_ANY_H_ 30 | #define _SEQUENCE_OF_ANY_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "ANY.h" 37 | #include "asn_SEQUENCE_OF.h" 38 | #include "constr_SEQUENCE_OF.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* SequenceOfANY */ 45 | typedef struct SequenceOfANY { 46 | A_SEQUENCE_OF(ANY_t) list; 47 | 48 | /* Context for parsing across buffer boundaries */ 49 | asn_struct_ctx_t _asn_ctx; 50 | } SequenceOfANY_t; 51 | 52 | /* Implementation */ 53 | extern asn_TYPE_descriptor_t SequenceOfANY_desc; 54 | UAPKIF_EXPORT asn_TYPE_descriptor_t* get_SequenceOfANY_desc(void); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /library/common/curl/include/curl/mprintf.h: -------------------------------------------------------------------------------- 1 | #ifndef CURLINC_MPRINTF_H 2 | #define CURLINC_MPRINTF_H 3 | /*************************************************************************** 4 | * _ _ ____ _ 5 | * Project ___| | | | _ \| | 6 | * / __| | | | |_) | | 7 | * | (__| |_| | _ <| |___ 8 | * \___|\___/|_| \_\_____| 9 | * 10 | * Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. 11 | * 12 | * This software is licensed as described in the file COPYING, which 13 | * you should have received as part of this distribution. The terms 14 | * are also available at https://curl.haxx.se/docs/copyright.html. 15 | * 16 | * You may opt to use, copy, modify, merge, publish, distribute and/or sell 17 | * copies of the Software, and permit persons to whom the Software is 18 | * furnished to do so, under the terms of the COPYING file. 19 | * 20 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY 21 | * KIND, either express or implied. 22 | * 23 | ***************************************************************************/ 24 | 25 | #include 26 | #include /* needed for FILE */ 27 | #include "curl.h" /* for CURL_EXTERN */ 28 | 29 | #ifdef __cplusplus 30 | extern "C" { 31 | #endif 32 | 33 | CURL_EXTERN int curl_mprintf(const char *format, ...); 34 | CURL_EXTERN int curl_mfprintf(FILE *fd, const char *format, ...); 35 | CURL_EXTERN int curl_msprintf(char *buffer, const char *format, ...); 36 | CURL_EXTERN int curl_msnprintf(char *buffer, size_t maxlength, 37 | const char *format, ...); 38 | CURL_EXTERN int curl_mvprintf(const char *format, va_list args); 39 | CURL_EXTERN int curl_mvfprintf(FILE *fd, const char *format, va_list args); 40 | CURL_EXTERN int curl_mvsprintf(char *buffer, const char *format, va_list args); 41 | CURL_EXTERN int curl_mvsnprintf(char *buffer, size_t maxlength, 42 | const char *format, va_list args); 43 | CURL_EXTERN char *curl_maprintf(const char *format, ...); 44 | CURL_EXTERN char *curl_mvaprintf(const char *format, va_list args); 45 | 46 | #ifdef __cplusplus 47 | } 48 | #endif 49 | 50 | #endif /* CURLINC_MPRINTF_H */ 51 | -------------------------------------------------------------------------------- /library/uapkif/include/CertBag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _CertBag_H_ 30 | #define _CertBag_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "OBJECT_IDENTIFIER.h" 37 | #include "ANY.h" 38 | #include "constr_SEQUENCE.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* CertBag */ 45 | typedef struct CertBag { 46 | OBJECT_IDENTIFIER_t certId; 47 | ANY_t certValue; 48 | 49 | /* Context for parsing across buffer boundaries */ 50 | asn_struct_ctx_t _asn_ctx; 51 | } CertBag_t; 52 | 53 | /* Implementation */ 54 | extern asn_TYPE_descriptor_t CertBag_desc; 55 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_CertBag_desc(void); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /library/uapkif/include/KepGost28147Params.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _KepGost28147Params_H_ 30 | #define _KepGost28147Params_H_ 31 | 32 | #include "asn_application.h" 33 | #include "OCTET_STRING.h" 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* KepGost28147Params */ 40 | typedef struct KepGost28147Params { 41 | OCTET_STRING_t dke; 42 | OCTET_STRING_t iv; 43 | OCTET_STRING_t key; 44 | 45 | /* Context for parsing across buffer boundaries */ 46 | asn_struct_ctx_t _asn_ctx; 47 | } KepGost28147Params_t; 48 | 49 | /* Implementation */ 50 | extern asn_TYPE_descriptor_t KepGost28147Params_desc; 51 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_KepGost28147Params_desc(void); 52 | 53 | #ifdef __cplusplus 54 | } 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /library/uapkif/include/NULL.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2004 Lev Walkin . All rights reserved. 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef ASN_TYPE_NULL_H 30 | #define ASN_TYPE_NULL_H 31 | 32 | #include "asn_application.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | /* 39 | * The value of the NULL type is meaningless: see BOOLEAN if you want to 40 | * carry true/false semantics. 41 | */ 42 | typedef int NULL_t; 43 | 44 | extern asn_TYPE_descriptor_t NULL_desc; 45 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_NULL_desc(void); 46 | 47 | asn_struct_print_f NULL_print; 48 | der_type_encoder_f NULL_encode_der; 49 | xer_type_decoder_f NULL_decode_xer; 50 | xer_type_encoder_f NULL_encode_xer; 51 | per_type_decoder_f NULL_decode_uper; 52 | per_type_encoder_f NULL_encode_uper; 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /library/uapkif/include/OtherPrimeInfos.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _OtherPrimeInfos_H_ 30 | #define _OtherPrimeInfos_H_ 31 | 32 | #include "asn_application.h" 33 | #include "asn_SEQUENCE_OF.h" 34 | 35 | #ifdef __cplusplus 36 | extern "C" { 37 | #endif 38 | 39 | /* Forward declarations */ 40 | struct OtherPrimeInfo; 41 | 42 | /* OtherPrimeInfos */ 43 | typedef struct OtherPrimeInfos { 44 | A_SEQUENCE_OF(struct OtherPrimeInfo) list; 45 | 46 | /* Context for parsing across buffer boundaries */ 47 | asn_struct_ctx_t _asn_ctx; 48 | } OtherPrimeInfos_t; 49 | 50 | /* Implementation */ 51 | extern asn_TYPE_descriptor_t OtherPrimeInfos_desc; 52 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_OtherPrimeInfos_desc(void); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /library/common/pkix/key-wrap.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKI_KEY_WRAP_H 29 | #define UAPKI_KEY_WRAP_H 30 | 31 | #include "uapkic.h" 32 | #include "cm-export.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | int key_wrap (const ByteArray* baPrivateKeyInfo, bool isStaticKey, 39 | const char* oidDhKdf, const char* oidWrapAlgo, 40 | const size_t count, const ByteArray** baSpkis, const ByteArray** baSessionKeys, 41 | ByteArray*** baSalts, ByteArray*** baWrappedKeys); 42 | 43 | int key_unwrap (const ByteArray* baPrivateKeyInfo, 44 | const char* oidDhKdf, const char* oidWrapAlgo, 45 | const size_t count, const ByteArray** baSpkis, const ByteArray** baSalts, 46 | const ByteArray** baWrappedKeys, ByteArray*** baSessionKeys); 47 | 48 | #ifdef __cplusplus 49 | } 50 | #endif 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /library/uapkif/include/Pentanomial.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _Pentanomial_H_ 30 | #define _Pentanomial_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "INTEGER.h" 37 | #include "constr_SEQUENCE.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /* Pentanomial */ 44 | typedef struct Pentanomial { 45 | INTEGER_t k; 46 | INTEGER_t j; 47 | INTEGER_t l; 48 | 49 | /* Context for parsing across buffer boundaries */ 50 | asn_struct_ctx_t _asn_ctx; 51 | } Pentanomial_t; 52 | 53 | /* Implementation */ 54 | extern asn_TYPE_descriptor_t Pentanomial_desc; 55 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_Pentanomial_desc(void); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /library/uapkif/include/ECDSA-Sig-Value.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _ECDSA_Sig_Value_H_ 30 | #define _ECDSA_Sig_Value_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "INTEGER.h" 37 | #include "constr_SEQUENCE.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /* ECDSA-Sig-Value */ 44 | typedef struct ECDSA_Sig_Value { 45 | INTEGER_t r; 46 | INTEGER_t s; 47 | 48 | /* Context for parsing across buffer boundaries */ 49 | asn_struct_ctx_t _asn_ctx; 50 | } ECDSA_Sig_Value_t; 51 | 52 | /* Implementation */ 53 | extern asn_TYPE_descriptor_t ECDSA_Sig_Value_desc; 54 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_ECDSA_Sig_Value_desc(void); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /library/uapkif/include/OtherName.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _OtherName_H_ 30 | #define _OtherName_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "OBJECT_IDENTIFIER.h" 37 | #include "ANY.h" 38 | #include "constr_SEQUENCE.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* OtherName */ 45 | typedef struct OtherName { 46 | OBJECT_IDENTIFIER_t type_id; 47 | ANY_t value; 48 | 49 | /* Context for parsing across buffer boundaries */ 50 | asn_struct_ctx_t _asn_ctx; 51 | } OtherName_t; 52 | 53 | /* Implementation */ 54 | extern asn_TYPE_descriptor_t OtherName_desc; 55 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_OtherName_desc(void); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /library/uapkif/include/PKIFreeText.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _PKIFreeText_H_ 30 | #define _PKIFreeText_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "UTF8String.h" 37 | #include "asn_SEQUENCE_OF.h" 38 | #include "constr_SEQUENCE_OF.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* PKIFreeText */ 45 | typedef struct PKIFreeText { 46 | A_SEQUENCE_OF(UTF8String_t) list; 47 | 48 | /* Context for parsing across buffer boundaries */ 49 | asn_struct_ctx_t _asn_ctx; 50 | } PKIFreeText_t; 51 | 52 | /* Implementation */ 53 | extern asn_TYPE_descriptor_t PKIFreeText_desc; 54 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_PKIFreeText_desc(void); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /library/uapkif/include/Hash.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _Hash_H_ 30 | #define _Hash_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "OCTET_STRING.h" 37 | 38 | #ifdef __cplusplus 39 | extern "C" { 40 | #endif 41 | 42 | /* Hash */ 43 | typedef OCTET_STRING_t Hash_t; 44 | 45 | /* Implementation */ 46 | extern asn_TYPE_descriptor_t Hash_desc; 47 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_Hash_desc(void); 48 | asn_struct_free_f Hash_free; 49 | asn_struct_print_f Hash_print; 50 | asn_constr_check_f Hash_constraint; 51 | ber_type_decoder_f Hash_decode_ber; 52 | der_type_encoder_f Hash_encode_der; 53 | xer_type_decoder_f Hash_decode_xer; 54 | xer_type_encoder_f Hash_encode_xer; 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /library/uapkif/include/KepDSTU4145Params.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _KepDSTU4145Params_H_ 30 | #define _KepDSTU4145Params_H_ 31 | 32 | #include "asn_application.h" 33 | #include "ANY.h" 34 | #include "OCTET_STRING.h" 35 | 36 | #ifdef __cplusplus 37 | extern "C" { 38 | #endif 39 | 40 | /* KepDSTU4145Params */ 41 | typedef struct KepDSTU4145Params { 42 | ANY_t params; 43 | OCTET_STRING_t dke; 44 | OCTET_STRING_t kekDke; 45 | 46 | /* Context for parsing across buffer boundaries */ 47 | asn_struct_ctx_t _asn_ctx; 48 | } KepDSTU4145Params_t; 49 | 50 | /* Implementation */ 51 | extern asn_TYPE_descriptor_t KepDSTU4145Params_desc; 52 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_KepDSTU4145Params_desc(void); 53 | 54 | #ifdef __cplusplus 55 | } 56 | #endif 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /library/uapkic/src/math-ec-point-internal.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Copyright 2016 PrivatBank IT 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef UAPKIC_MATH_EC_POINT_H 30 | #define UAPKIC_MATH_EC_POINT_H 31 | 32 | #include "word-internal.h" 33 | 34 | #ifdef __cplusplus 35 | extern "C" { 36 | #endif 37 | 38 | typedef struct ECPoint_st { 39 | WordArray *x; 40 | WordArray *y; 41 | WordArray *z; 42 | } ECPoint; 43 | 44 | ECPoint *ec_point_alloc(size_t len); 45 | ECPoint *ec_point_aff_alloc(const WordArray *px, const WordArray *py); 46 | ECPoint *ec_point_proj_alloc(const WordArray *px, const WordArray *py, const WordArray *pz); 47 | void ec_point_zero(ECPoint *p); 48 | void ec_point_copy(const ECPoint *a, ECPoint *out); 49 | ECPoint *ec_point_copy_with_alloc(const ECPoint *a); 50 | void ec_point_free(ECPoint *p); 51 | 52 | #ifdef __cplusplus 53 | } 54 | #endif 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /library/uapkif/include/ContentInfo.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _ContentInfo_H_ 30 | #define _ContentInfo_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "ContentType.h" 37 | #include "ANY.h" 38 | #include "constr_SEQUENCE.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* ContentInfo */ 45 | typedef struct ContentInfo { 46 | ContentType_t contentType; 47 | ANY_t content; 48 | 49 | /* Context for parsing across buffer boundaries */ 50 | asn_struct_ctx_t _asn_ctx; 51 | } ContentInfo_t; 52 | 53 | /* Implementation */ 54 | extern asn_TYPE_descriptor_t ContentInfo_desc; 55 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_ContentInfo_desc(void); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /library/uapkif/include/Attributes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _Attributes_H_ 30 | #define _Attributes_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "asn_SET_OF.h" 37 | #include "constr_SET_OF.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /* Forward declarations */ 44 | struct Attribute; 45 | 46 | /* Attributes */ 47 | typedef struct Attributes { 48 | A_SET_OF(struct Attribute) list; 49 | 50 | /* Context for parsing across buffer boundaries */ 51 | asn_struct_ctx_t _asn_ctx; 52 | } Attributes_t; 53 | 54 | /* Implementation */ 55 | extern asn_TYPE_descriptor_t Attributes_desc; 56 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_Attributes_desc(void); 57 | 58 | #ifdef __cplusplus 59 | } 60 | #endif 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /library/uapkif/include/SecretBag.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _SecretBag_H_ 30 | #define _SecretBag_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "OBJECT_IDENTIFIER.h" 37 | #include "ANY.h" 38 | #include "constr_SEQUENCE.h" 39 | 40 | #ifdef __cplusplus 41 | extern "C" { 42 | #endif 43 | 44 | /* SecretBag */ 45 | typedef struct SecretBag { 46 | OBJECT_IDENTIFIER_t secretTypeId; 47 | ANY_t secretValue; 48 | 49 | /* Context for parsing across buffer boundaries */ 50 | asn_struct_ctx_t _asn_ctx; 51 | } SecretBag_t; 52 | 53 | /* Implementation */ 54 | extern asn_TYPE_descriptor_t SecretBag_desc; 55 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_SecretBag_desc(void); 56 | 57 | #ifdef __cplusplus 58 | } 59 | #endif 60 | 61 | #endif 62 | -------------------------------------------------------------------------------- /library/uapki/src/signature-format.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2021, The UAPKI Project Authors. 3 | * 4 | * Redistribution and use in source and binary forms, with or without 5 | * modification, are permitted provided that the following conditions are 6 | * met: 7 | * 8 | * 1. Redistributions of source code must retain the above copyright 9 | * notice, this list of conditions and the following disclaimer. 10 | * 11 | * 2. Redistributions in binary form must reproduce the above copyright 12 | * notice, this list of conditions and the following disclaimer in the 13 | * documentation and/or other materials provided with the distribution. 14 | * 15 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 16 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 18 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 19 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 20 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 21 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 22 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 23 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 24 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef UAPKI_NS_SIGNATURE_FORMAT_H 29 | #define UAPKI_NS_SIGNATURE_FORMAT_H 30 | 31 | 32 | #include 33 | #include 34 | 35 | 36 | namespace UapkiNS { 37 | 38 | enum class SignatureFormat : uint32_t { 39 | UNDEFINED = 0, 40 | RAW = 1, 41 | CMS_SID_KEYID = 2, 42 | CADES_BES = 3, 43 | CADES_T = 4, 44 | CADES_C = 5, 45 | CADES_XL = 6, 46 | CADES_A = 7 47 | }; // end enum SignatureFormat 48 | 49 | SignatureFormat signatureFormatFromString (const std::string& str); 50 | const char* signatureFormatToStr (const SignatureFormat signatureFormat); 51 | std::string signatureFormatToString (const SignatureFormat signatureFormat); 52 | 53 | } // end namespace UapkiNS 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /library/uapkif/include/GOST28147Params.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright 2021 The UAPKI Project Authors. 3 | * Generated by asn1c-0.9.28 (http://lionet.info/asn1c) 4 | * 5 | * Redistribution and use in source and binary forms, with or without 6 | * modification, are permitted provided that the following conditions are 7 | * met: 8 | * 9 | * 1. Redistributions of source code must retain the above copyright 10 | * notice, this list of conditions and the following disclaimer. 11 | * 12 | * 2. Redistributions in binary form must reproduce the above copyright 13 | * notice, this list of conditions and the following disclaimer in the 14 | * documentation and/or other materials provided with the distribution. 15 | * 16 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 17 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A 19 | * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20 | * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED 22 | * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 23 | * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 24 | * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 25 | * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | */ 28 | 29 | #ifndef _GOST28147Params_H_ 30 | #define _GOST28147Params_H_ 31 | 32 | 33 | #include "asn_application.h" 34 | 35 | /* Including external dependencies */ 36 | #include "OCTET_STRING.h" 37 | #include "constr_SEQUENCE.h" 38 | 39 | #ifdef __cplusplus 40 | extern "C" { 41 | #endif 42 | 43 | /* GOST28147Params */ 44 | typedef struct GOST28147Params { 45 | OCTET_STRING_t iv; 46 | OCTET_STRING_t dke; 47 | 48 | /* Context for parsing across buffer boundaries */ 49 | asn_struct_ctx_t _asn_ctx; 50 | } GOST28147Params_t; 51 | 52 | /* Implementation */ 53 | extern asn_TYPE_descriptor_t GOST28147Params_desc; 54 | UAPKIF_EXPORT asn_TYPE_descriptor_t *get_GOST28147Params_desc(void); 55 | 56 | #ifdef __cplusplus 57 | } 58 | #endif 59 | 60 | #endif 61 | --------------------------------------------------------------------------------