diff --git a/CMakeLists.txt b/CMakeLists.txt
index d065316..905a550 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.13)
-project(dstu-engine LANGUAGES C VERSION 1.2.2)
+project(dstu-engine LANGUAGES C VERSION 1.3.0)
option(BUILD_TESTS "Build tests." OFF)
option(ENABLE_CODECOV "Enable code coverage analysis." OFF)
@@ -25,6 +25,7 @@ bugprone-*,\
-clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling,\
-bugprone-easily-swappable-parameters,\
-modernize-avoid-bind,\
+-misc-no-recursion,\
-modernize-use-trailing-return-type,\
-readability-braces-around-statements, \
-readability-function-cognitive-complexity,\
diff --git a/Doxyfile b/Doxyfile
index f73cda0..2d5933a 100644
--- a/Doxyfile
+++ b/Doxyfile
@@ -829,7 +829,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = README.md keylib/key6.h keylib/jks.h
+INPUT = README.md keylib/key6.h keylib/jks.h keylib/pkcs12.h keylib/keystore.h
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/README.md b/README.md
index d3663af..b08241f 100644
--- a/README.md
+++ b/README.md
@@ -79,14 +79,10 @@ ENGINE_set_default(engine, ENGINE_METHOD_ALL);
auto* fp = fopen(file.c_str(), "r");
-// Key-6.dat may contain 1 or 2 keys
-EVP_PKEY** keys = nullptr;
-size_t numKeys = 0;
-readKey6(fp, password.c_str(), password.length(), &keys, &numKeys);
-
-// Delete all keys after use
-for (size_t i = 0; i < numKeys; ++i)
- EVP_PKEY_free(keys[i]);
+KeyStore* ks = NULL;
+readKey6(fp, password.c_str(), password.length(), &ks);
+
+KeyStoreFree(ks);
OPENSSL_free(keys);
fclose(fp);
diff --git a/docs/dir_5e57c488afef9ef24045388a5764f023.html b/docs/dir_5e57c488afef9ef24045388a5764f023.html
index 3c6a2f3..74990f4 100644
--- a/docs/dir_5e57c488afef9ef24045388a5764f023.html
+++ b/docs/dir_5e57c488afef9ef24045388a5764f023.html
@@ -1,9 +1,9 @@
-
+
-
+
Keylib: keylib Directory Reference
@@ -30,21 +30,18 @@
-
+
+
file key6.h [code]
Functions for reading keys from IIT Key-6.dat container.
+
file keystore.h [code]
+
KeyStore is a container for keys and certificates.
+
+
file pkcs12.h [code]
+
Functions for reading keys from PKCS#12 container.
+
diff --git a/docs/doxygen.css b/docs/doxygen.css
index 73ecbb2..4f1ab91 100644
--- a/docs/doxygen.css
+++ b/docs/doxygen.css
@@ -1,4 +1,4 @@
-/* The standard CSS for doxygen 1.8.17 */
+/* The standard CSS for doxygen 1.8.13 */
body, table, div, p, dl {
font: 400 14px/22px Roboto,sans-serif;
@@ -53,24 +53,17 @@ dt {
font-weight: bold;
}
-ul.multicol {
+div.multicol {
-moz-column-gap: 1em;
-webkit-column-gap: 1em;
- column-gap: 1em;
-moz-column-count: 3;
-webkit-column-count: 3;
- column-count: 3;
}
p.startli, p.startdd {
margin-top: 2px;
}
-th p.starttd, p.intertd, p.endtd {
- font-size: 100%;
- font-weight: 700;
-}
-
p.starttd {
margin-top: 0px;
}
@@ -87,15 +80,6 @@ p.endtd {
margin-bottom: 2px;
}
-p.interli {
-}
-
-p.interdd {
-}
-
-p.intertd {
-}
-
/* @end */
caption {
@@ -150,12 +134,12 @@ a.qindex {
a.qindexHL {
font-weight: bold;
background-color: #9CAFD4;
- color: #FFFFFF;
+ color: #ffffff;
border: 1px double #869DCA;
}
.contents a.qindexHL:visited {
- color: #FFFFFF;
+ color: #ffffff;
}
a.el {
@@ -179,25 +163,6 @@ dl.el {
margin-left: -1cm;
}
-ul {
- overflow: hidden; /*Fixed: list item bullets overlap floating elements*/
-}
-
-#side-nav ul {
- overflow: visible; /* reset ul rule for scroll bar in GENERATE_TREEVIEW window */
-}
-
-#main-nav ul {
- overflow: visible; /* reset ul rule for the navigation bar drop down lists */
-}
-
-.fragment {
- text-align: left;
- direction: ltr;
- overflow-x: auto; /*Fixed: fragment lines overlap floating elements*/
- overflow-y: hidden;
-}
-
pre.fragment {
border: 1px solid #C4CFE5;
background-color: #FBFCFD;
@@ -212,8 +177,8 @@ pre.fragment {
}
div.fragment {
- padding: 0 0 1px 0; /*Fixed: last line underline overlap border*/
- margin: 4px 8px 4px 2px;
+ padding: 0px;
+ margin: 4px 8px 4px 2px;
background-color: #FBFCFD;
border: 1px solid #C4CFE5;
}
@@ -283,7 +248,7 @@ span.lineno a:hover {
div.ah, span.ah {
background-color: black;
font-weight: bold;
- color: #FFFFFF;
+ color: #ffffff;
margin-bottom: 3px;
margin-top: 3px;
padding: 0.2em;
@@ -359,7 +324,7 @@ img.formulaDsp {
}
-img.formulaInl, img.inline {
+img.formulaInl {
vertical-align: middle;
}
@@ -437,13 +402,6 @@ blockquote {
padding: 0 12px 0 16px;
}
-blockquote.DocNodeRTL {
- border-left: 0;
- border-right: 2px solid #9CAFD4;
- margin: 0 4px 0 24px;
- padding: 0 16px 0 12px;
-}
-
/* @end */
/*
@@ -540,7 +498,7 @@ table.memberdecls {
white-space: nowrap;
}
-.memItemRight, .memTemplItemRight {
+.memItemRight {
width: 100%;
}
@@ -708,17 +666,17 @@ dl.reflist dd {
padding-left: 0px;
}
-.params .paramname, .retval .paramname, .tparams .paramname, .exception .paramname {
+.params .paramname, .retval .paramname {
font-weight: bold;
vertical-align: top;
}
-.params .paramtype, .tparams .paramtype {
+.params .paramtype {
font-style: italic;
vertical-align: top;
}
-.params .paramdir, .tparams .paramdir {
+.params .paramdir {
font-family: "courier new",courier,monospace;
vertical-align: top;
}
@@ -1123,143 +1081,72 @@ div.headertitle
padding: 5px 5px 5px 10px;
}
-.PageDocRTL-title div.headertitle {
- text-align: right;
- direction: rtl;
-}
-
-dl {
- padding: 0 0 0 0;
+dl
+{
+ padding: 0 0 0 10px;
}
-/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug, dl.examples */
-dl.section {
+/* dl.note, dl.warning, dl.attention, dl.pre, dl.post, dl.invariant, dl.deprecated, dl.todo, dl.test, dl.bug */
+dl.section
+{
margin-left: 0px;
padding-left: 0px;
}
-dl.section.DocNodeRTL {
- margin-right: 0px;
- padding-right: 0px;
-}
-
-dl.note {
- margin-left: -7px;
- padding-left: 3px;
- border-left: 4px solid;
- border-color: #D0C000;
-}
-
-dl.note.DocNodeRTL {
- margin-left: 0;
- padding-left: 0;
- border-left: 0;
- margin-right: -7px;
- padding-right: 3px;
- border-right: 4px solid;
- border-color: #D0C000;
-}
-
-dl.warning, dl.attention {
- margin-left: -7px;
- padding-left: 3px;
- border-left: 4px solid;
- border-color: #FF0000;
-}
-
-dl.warning.DocNodeRTL, dl.attention.DocNodeRTL {
- margin-left: 0;
- padding-left: 0;
- border-left: 0;
- margin-right: -7px;
- padding-right: 3px;
- border-right: 4px solid;
- border-color: #FF0000;
-}
-
-dl.pre, dl.post, dl.invariant {
- margin-left: -7px;
- padding-left: 3px;
- border-left: 4px solid;
- border-color: #00D000;
-}
-
-dl.pre.DocNodeRTL, dl.post.DocNodeRTL, dl.invariant.DocNodeRTL {
- margin-left: 0;
- padding-left: 0;
- border-left: 0;
- margin-right: -7px;
- padding-right: 3px;
- border-right: 4px solid;
- border-color: #00D000;
+dl.note
+{
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #D0C000;
}
-dl.deprecated {
- margin-left: -7px;
- padding-left: 3px;
- border-left: 4px solid;
- border-color: #505050;
+dl.warning, dl.attention
+{
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #FF0000;
}
-dl.deprecated.DocNodeRTL {
- margin-left: 0;
- padding-left: 0;
- border-left: 0;
- margin-right: -7px;
- padding-right: 3px;
- border-right: 4px solid;
- border-color: #505050;
+dl.pre, dl.post, dl.invariant
+{
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #00D000;
}
-dl.todo {
- margin-left: -7px;
- padding-left: 3px;
- border-left: 4px solid;
- border-color: #00C0E0;
+dl.deprecated
+{
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #505050;
}
-dl.todo.DocNodeRTL {
- margin-left: 0;
- padding-left: 0;
- border-left: 0;
- margin-right: -7px;
- padding-right: 3px;
- border-right: 4px solid;
- border-color: #00C0E0;
+dl.todo
+{
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #00C0E0;
}
-dl.test {
- margin-left: -7px;
- padding-left: 3px;
- border-left: 4px solid;
- border-color: #3030E0;
+dl.test
+{
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #3030E0;
}
-dl.test.DocNodeRTL {
- margin-left: 0;
- padding-left: 0;
- border-left: 0;
- margin-right: -7px;
- padding-right: 3px;
- border-right: 4px solid;
- border-color: #3030E0;
-}
-
-dl.bug {
- margin-left: -7px;
- padding-left: 3px;
- border-left: 4px solid;
- border-color: #C08050;
-}
-
-dl.bug.DocNodeRTL {
- margin-left: 0;
- padding-left: 0;
- border-left: 0;
- margin-right: -7px;
- padding-right: 3px;
- border-right: 4px solid;
- border-color: #C08050;
+dl.bug
+{
+ margin-left:-7px;
+ padding-left: 3px;
+ border-left:4px solid;
+ border-color: #C08050;
}
dl.section dd {
@@ -1376,11 +1263,6 @@ div.toc {
width: 200px;
}
-.PageDocRTL-title div.toc {
- float: left !important;
- text-align: right;
-}
-
div.toc li {
background: url("bdwn.png") no-repeat scroll 0 5px transparent;
font: 10px/1.2 Verdana,DejaVu Sans,Geneva,sans-serif;
@@ -1389,12 +1271,6 @@ div.toc li {
padding-top: 2px;
}
-.PageDocRTL-title div.toc li {
- background-position-x: right !important;
- padding-left: 0 !important;
- padding-right: 10px;
-}
-
div.toc h3 {
font: bold 12px/1.2 Arial,FreeSans,sans-serif;
color: #4665A2;
@@ -1424,26 +1300,6 @@ div.toc li.level4 {
margin-left: 45px;
}
-.PageDocRTL-title div.toc li.level1 {
- margin-left: 0 !important;
- margin-right: 0;
-}
-
-.PageDocRTL-title div.toc li.level2 {
- margin-left: 0 !important;
- margin-right: 15px;
-}
-
-.PageDocRTL-title div.toc li.level3 {
- margin-left: 0 !important;
- margin-right: 30px;
-}
-
-.PageDocRTL-title div.toc li.level4 {
- margin-left: 0 !important;
- margin-right: 45px;
-}
-
.inherit_header {
font-weight: bold;
color: gray;
@@ -1557,7 +1413,7 @@ tr.heading h2 {
}
#powerTip.n:after, #powerTip.ne:after, #powerTip.nw:after {
- border-top-color: #FFFFFF;
+ border-top-color: #ffffff;
border-width: 10px;
margin: 0px -10px;
}
@@ -1585,7 +1441,7 @@ tr.heading h2 {
}
#powerTip.s:after, #powerTip.se:after, #powerTip.sw:after {
- border-bottom-color: #FFFFFF;
+ border-bottom-color: #ffffff;
border-width: 10px;
margin: 0px -10px;
}
@@ -1612,7 +1468,7 @@ tr.heading h2 {
left: 100%;
}
#powerTip.e:after {
- border-left-color: #FFFFFF;
+ border-left-color: #ffffff;
border-width: 10px;
top: 50%;
margin-top: -10px;
@@ -1628,7 +1484,7 @@ tr.heading h2 {
right: 100%;
}
#powerTip.w:after {
- border-right-color: #FFFFFF;
+ border-right-color: #ffffff;
border-width: 10px;
top: 50%;
margin-top: -10px;
@@ -1736,36 +1592,5 @@ th.markdownTableHeadCenter, td.markdownTableBodyCenter {
text-align: center
}
-.DocNodeRTL {
- text-align: right;
- direction: rtl;
-}
-
-.DocNodeLTR {
- text-align: left;
- direction: ltr;
-}
-
-table.DocNodeRTL {
- width: auto;
- margin-right: 0;
- margin-left: auto;
-}
-table.DocNodeLTR {
- width: auto;
- margin-right: auto;
- margin-left: 0;
-}
-
-tt, code, kbd, samp
-{
- display: inline-block;
- direction:ltr;
-}
/* @end */
-
-u {
- text-decoration: underline;
-}
-
diff --git a/docs/dynsections.js b/docs/dynsections.js
index ea0a7b3..85e1836 100644
--- a/docs/dynsections.js
+++ b/docs/dynsections.js
@@ -1,26 +1,3 @@
-/*
- @licstart The following is the entire license notice for the
- JavaScript code in this file.
-
- Copyright (C) 1997-2017 by Dimitri van Heesch
-
- This program is free software; you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-
- @licend The above is the entire license notice
- for the JavaScript code in this file
- */
function toggleVisibility(linkObj)
{
var base = $(linkObj).attr('id');
@@ -38,7 +15,7 @@ function toggleVisibility(linkObj)
summary.hide();
$(linkObj).removeClass('closed').addClass('opened');
$(trigger).attr('src',src.substring(0,src.length-10)+'open.png');
- }
+ }
return false;
}
@@ -117,4 +94,4 @@ function toggleInherit(id)
$(img).attr('src',src.substring(0,src.length-10)+'open.png');
}
}
-/* @license-end */
+
diff --git a/docs/files.html b/docs/files.html
index a47ed10..25f441b 100644
--- a/docs/files.html
+++ b/docs/files.html
@@ -1,9 +1,9 @@
-
+
-
+
Keylib: File List
@@ -30,21 +30,18 @@
-
+
+
@@ -71,6 +68,8 @@
▼ keylib
jks.h Functions for reading keys from Java Key Storage
key6.h Functions for reading keys from IIT Key-6.dat container
+ keystore.h KeyStore is a container for keys and certificates
+ pkcs12.h Functions for reading keys from PKCS#12 container
@@ -78,7 +77,7 @@
diff --git a/docs/globals.html b/docs/globals.html
index 9da8046..80d1ac1 100644
--- a/docs/globals.html
+++ b/docs/globals.html
@@ -1,9 +1,9 @@
-
+
-
+
Keylib: File Members
@@ -30,21 +30,18 @@
-
+
+
@@ -63,77 +60,50 @@
Here is a list of all documented file members with links to the documentation:
@@ -141,7 +111,7 @@
diff --git a/docs/globals_func.html b/docs/globals_func.html
index 2f9a60b..e68b140 100644
--- a/docs/globals_func.html
+++ b/docs/globals_func.html
@@ -1,9 +1,9 @@
-
+
-
+
Keylib: File Members
@@ -30,21 +30,18 @@
-
+
+
@@ -63,59 +60,47 @@
@@ -123,7 +108,7 @@
diff --git a/docs/globals_type.html b/docs/globals_type.html
index 8e67119..db7fe0c 100644
--- a/docs/globals_type.html
+++ b/docs/globals_type.html
@@ -1,9 +1,9 @@
-
+
-
+
Keylib: File Members
@@ -30,21 +30,18 @@
-
+
+
@@ -63,11 +60,8 @@
@@ -75,7 +69,7 @@
diff --git a/docs/index.html b/docs/index.html
index 63c7da3..f3d2ea3 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1,9 +1,9 @@
-
+
-
+
Keylib: Main Page
@@ -30,21 +30,18 @@
-
+
+
@@ -61,111 +58,26 @@
-
diff --git a/docs/jks_8h.html b/docs/jks_8h.html
index dd22bf1..49bf49a 100644
--- a/docs/jks_8h.html
+++ b/docs/jks_8h.html
@@ -1,9 +1,9 @@
-
+
-
+
Keylib: keylib/jks.h File Reference
@@ -30,21 +30,18 @@
-
+
+