bmwcarit / mococrw Goto Github PK
View Code? Open in Web Editor NEW(mo)dern (c)++ (o)penssl (cr)ypto (w)rapper library
License: Apache License 2.0
(mo)dern (c)++ (o)penssl (cr)ypto (w)rapper library
License: Apache License 2.0
Hi,
I need to create an ECIESEncryptionCtx (and an ECIESDecryption context) using already owned encryption keys, so I should create an AsymmetricKeyPair object containing those keys.
How can I do that?
Following code, note setting of an empty IV vector:
auto decryptor = mococrw::AESCipherBuilder{mococrw::SymmetricCipherMode::GCM,
mococrw::SymmetricCipherKeySize::S_128,
mKey}
.setPadding(mococrw::SymmetricCipherPadding::NO)
.setIV({})
.buildAuthenticatedDecryptor();
Results in an exception:
terminate called after throwing an instance of 'mococrw::openssl::OpenSSLException'
what(): error:00000000:lib(0):func(0):reason(0): 0
Which has no useful information for a developer to understand the issue. Maybe this can be improved.
The "sanity check" in CertificateAuthority::_signCSR()
does not allow me to sign a certificate with expired validity or a certificate that will be valid in the future, because validation at the moment must succeed at the end of the function. Anything that is not valid at the moment of the signature can not be signed.
Hello,
I have to use ECIES encyrption scheme to implement this communications scheme, but for me is hard to understand which parameters I must use in ECIESCtxBuilder
class to create ECIESEncryptionCtx
and ECIESDecryptionCtx
classes.
Can you help me?
Dear all,
I'm facing a compilation error:
/home/ycheng/MoCOCrW/src/openssl_lib.cpp:788:32: error: invalid conversion from ‘const ec_key_st*’ to ‘EC_KEY*’ {aka ‘ec_key_st*’} [-fpermissive]
788 | return EVP_PKEY_get0_EC_KEY(pkey);
| ~~~~~~~~~~~~~~~~~~~~^~~~~~
| |
| const ec_key_st*
Can you please help me on this? Thanks a lot!
Few questions about versioning:
When a CA's X509Certificate
is loaded from a PEM file and then used to sign a certificate, the Issuer name in the signed certificate ends up with attributes in a different order from the Subject name in the parent CA certificate.
For instance, my CA had:
Subject: C = PT, ST = Testing, O = Critical TechWorks, OU = Chronos Team, CN = Test-Signing-CA
while the signed certificate ended up with:
Issuer: CN = Test-Signing-CA, C = PT, ST = Testing, OU = Chronos Team, O = Critical TechWorks
This causes the MoCOCrW itself to fail to validate the certificate it just signed (as well as openssl command line), and the sanity check inside function CertificateAuthority::_signCSR()
throws an mococrw::MoCOCrWException
with the error:
what(): Certificate creation failed: the generated certificate is invalid: unable to get local issuer certificate
Hello!
I'm trying to compile this library in a docker image with OpenSSL at version 1.1.0l, but when I start to compile the process fails immediately:
root@4cba3a1fe286:~# cmake -Bbuild -SMoCOCrW -DBUILD_TESTING=Off
CMake Warning (dev) in CMakeLists.txt:
No project() command is present. The top-level CMakeLists.txt file must
contain a literal, direct call to the project() command. Add a line of
code such as
project(ProjectName)
near the top of the file, but after cmake_minimum_required().
CMake is pretending there is a "project(Project)" command on the first
line.
This warning is for project developers. Use -Wno-dev to suppress it.
-- The C compiler identification is GNU 6.3.0
-- The CXX compiler identification is GNU 6.3.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ - works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found OpenSSL: /usr/lib/x86_64-linux-gnu/libcrypto.so (found version "1.1.0l")
-- Using OpenSSL 1.1.0l
-- Found Boost: /usr/include (found version "1.62.0")
-- Configuring done
-- Generating done
-- Build files have been written to: /root/build
root@4cba3a1fe286:~# cmake --build build
Scanning dependencies of target mococrw
[ 4%] Building CXX object src/CMakeFiles/mococrw.dir/asn1time.cpp.o
In file included from /root/MoCOCrW/src/mococrw/asn1time.h:21:0,
from /root/MoCOCrW/src/asn1time.cpp:19:
/root/MoCOCrW/src/mococrw/openssl_wrap.h:1349:13: error: 'NID_ED448' was not declared in this scope
Ed448 = NID_ED448,
^~~~~~~~~
/root/MoCOCrW/src/mococrw/openssl_wrap.h:1350:15: error: 'NID_ED25519' was not declared in this scope
Ed25519 = NID_ED25519
^~~~~~~~~~~
src/CMakeFiles/mococrw.dir/build.make:79: recipe for target 'src/CMakeFiles/mococrw.dir/asn1time.cpp.o' failed
make[2]: *** [src/CMakeFiles/mococrw.dir/asn1time.cpp.o] Error 1
CMakeFiles/Makefile2:149: recipe for target 'src/CMakeFiles/mococrw.dir/all' failed
make[1]: *** [src/CMakeFiles/mococrw.dir/all] Error 2
Makefile:146: recipe for target 'all' failed
make: *** [all] Error 2
The branch I'm trying to compile is openssl1.1.
Can you help me?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.