Giter VIP home page Giter VIP logo

licensepp's Introduction

Software licensing using digital signatures 🪪

Apache 2.0

License++ is a cross platform software licensing library that uses digital signatures to secure use of your application and its licensing.

Abstract

I created a concept of digital software licence and implemented it under this project. The digital licence would be issued by an issuing authority with a digital signature. The whole process is protected by public-key cryptography signing scheme. This guarantees that the generation of new licenses is restricted, and any attempts to tamper with an issued license are prevented, similar to how we are issued with driver's licence, or better.

Features

  • RSA-Based signing to prevent alteration
  • Custom license keys for your software
  • Anyone can check the license validity
  • Restricted issuance of new licenses
  • Disable issuing authority at anytime

Getting Started

Dependencies

  • C++11 (C++14 if you are also building tests, since latest Google C++ Testing Library requires C++14)
  • Crypto++ v5.6.5+ with Pem Pack
  • cmake v2.8.12+
  • Ripe

Installation

  • Clone the repo
     git clone [email protected]:abumq/licensepp.git
    
  • Install Crypto++
     wget https://raw.githubusercontent.com/abumq/abumq.github.io/master/downloads/cryptocpp.tar.gz
     tar xf cryptocpp.tar.gz
     cd cryptopp-CRYPTOPP_5_6_5
     wget https://raw.githubusercontent.com/abumq/abumq.github.io/master/downloads/pem_pack.zip
     unzip pem_pack.zip
     cmake .
     make
     sudo make install
    
  • Install Ripe (if this fails, refer to full build instructions on the github)
      git clone [email protected]:abumq/ripe.git
      mkdir build
      cd build
      cmake ..
      make
      sudo make install
    
  • Use CMake to build the project
    cd licensepp
    mkdir build
    cd build
    cmake ..
    make
    sudo make install
    
    ## build with test (make sure you have Google C++ Testing Library)
    cmake -Dtest=ON ..
    make
    sudo make install
    ./licensepp-unit-tests
    
  • You can build cli tool to ensure license++ is installed properly

Integration

Once you have license++ properly installed please check out sample code for integration

Generate New Authority Key

Authority key is what is in key register (LICENSE_ISSUING_AUTHORITIES) You will need to generate a custom key for your software. This key is used to sign the digital license.

Authority key is essentially RSA keypair with : seperator. Format of this key can be defined as:

base64_encode(
 pem_format(
   rsa_private_key
 )
):base64_encode(
 pem_format(
   rsa_public_key
 )
)

You can use ripe command to generate new authority key or you can use openssl CLI tool to do so

ripe -g --rsa --length 2048 [--secret <secret>]

This will generate something like:

LS0tLS1CRUdJTiBSU0EgUFJJVkFURSBLRVktLS0tLQpNSUlFb2dJQkFBS0NBUUVBM0NGOENidXQyUlIvdXo4T3JmZ1VVNGtmTUdRZWtTNDQzbVVxQkFTeUpibjU3bmhPCllQbjA3N0hSaXZVNk9mYWp6YWFVRFVOZGFseDlFVmJ1YnYwNGQ0KzBHeTFMbDRPUXFITTg3eVRXSG81Z1JYbGcKNGlCeUFDRnVYMGVaNm1iSC9SWmFQcjZHT2ZrVTdJMVJ6V1dDUlYwc1IyN0N5Q1VkM0lScnduS2JSdzRUQkt0Tgpkakk5M3BncDZGWXN1UjFtU3FWSlVqWjhPY29EWTd1MHJUOStadEhMckQyeGh4YWE5N2RFOEtiMEJhbnlwMThaCmFORmY4M2pRbVZia0xra0F6c1RZczdyekRyVDNCbXN2SG1uTFlUTHBUSjM5SktLRmMvWXZBbjFQN3VWMDlXaG8KSTVPL2pyWXFoRmNEYTN0dkVCTkJPT3Z3aUhZZVZ2bjJuWW5QUXdJQkVRS0NBUUFNOHVrdHY3N3VwdHBXVHdEZApEcGZJcmJhS1lENElpaitVbklvQVBJTHpLUTZ6ckxsUS82VC9Dblc4NFQrcERvSWJKK3FYWGxES0JYREV5T0RaCldqQi9nT3g2RWJrbkI3MDNGZFpvYTVRZjZrSGwrQlRDQWVpV21JNEZtc3pSalpOTEgyNjRaWTlzMG1xa2dNaVQKbkk4eFFiZFBmdnhtSUUwTStMc0xjQ2RBYWlGZnBqdGtoK3d4Wm9UV29EMVQraXgyNGxQa3JBVHpiVXU4bDZwYgoyTW0xbGJnWE1icGIvaFdtcVR4TUFFcW9hVTNXS1lTb1RpQ2kwVHZNNXJ1aStya3cvRm5XMnpzTGFHYWhQWGlqClR5RVAzdXJDSGdIUG9EMG1hbWlIVnpmQUJFSFJVWURjZlNOOTJlQlRsZlVLUHBRYVI3SWY4TjVQNDVucXZLalAKRUNSUkFvR0JBTjlOSmdjSmVpR0xOS1daa3p2QTIvVkl2b1cwbEFuRmhROFRNb3BMYzdmQUtPZXZEMkwyclpXSQpjUFhuWjR4Q2ZLaDlYbmtISklST3dsVmxpVmd1cjBrQkFtbkZiVU4vZFJXR0hGVnJpTlgvVnNXZDRib3oyeEpOClhSRXNIenZUdmh0bnVJZjFzNzViOFlBQ3d4ek9IcDgvR0hhZVJnRndjNmtUeEhhU0Jxd3hBb0dCQVB4ZGUxUy8Kc1cwTGxMSU9IdDVrcEgwYzN6RnVOaDVLQXV6S2R0cElabUdYdDZweTRPNTBpWlZlQ1UzOU9uS1VMeDd4UHRFMApmTERVMFlLWWV4WXM4MnVOQUhlcHZzUE5VUkRMT2RiYW44TlVEb3pLdmlRbkkyT1ppQ3paazJCYTN2cW5SbEdKCmtLWFhUTVQwbnFEdk5Qb1NOL1o3cHl2SjVUeXNya3BMY0xtekFvR0JBSjJmM3B1T09CZXRqcE1DL29TSUlzdEMKYUY1aFdYQlBNTDlZMkdHZXJBazhXUndER2V1QTh3QWtFNEJuRytxSlNPOW5qZnNVR2NiT0x0TGVRdFRWcU9nOAo4cVVEMUtnZHZBOHhmV2w1RlV2RFRFOUNSUHZvWG1kRnF4c3VOQ283SE1nTStycFRGWGRQOWNQRnR1Y29GWjJWCjh5YU4xeEFUSkhkWlAyTEJiaDh4QW9HQVorcEIxNW81LzdsNWRuNUk4aWx3NkRrUW0rSVdTTFVRUTJKdExMUm0KWkd1bCt1UUNSQkhlVEpBaDh1L014Y1NMMzVDRFJ4V2N3VWlTZ1JHY0dEQ2dkNVJwbXE5T2pOd1NValdRU1drVQptN2t6S3VvU0R1THdkRTVISVliRU5yd0Jka1RndUNtVjZlODl1b0xYNStvR3dWTEx2OWlRSVJibDY4NmlIcGVJCnhPOENnWUVBa21CWEV4dHZ0d3ZJOXhleEFpalVhS1dqalNiM2VnbS9rV3VXRjhVUmRxeTR4US80WVBYSTFuZUIKNlBlSjcrSkFIakJtNGlhTm9tMkptM3J2aVA3dStFMzlwNDhrSSszWlFpd2FzeTUyTmdkL3kxS3lJeFNTM2JFWApoZXdIQU1qbWh4YVh3R1c4TWJZbW4xSklsTWhzTmZIcUhHQ1lQNklYR3hzR0pqeXFJdmc9Ci0tLS0tRU5EIFJTQSBQUklWQVRFIEtFWS0tLS0tCg==

Which is base64-encoded keypair seperated with :

Generate New Signature Key

License++ signature key is what's used to sign the licensee's signature. This is to protect the information with AES-CBC-128. Signature key is defined in 128-bit array in key register (LICENSE_MANAGER_SIGNATURE_KEY)

You can use ripe to generate new key

ripe -g --aes --length 128

This will produce something like 82F36C25A912389ABFF8091C759303D2. You then seperate each hex to create C++ array, i.e,

0x82, 0xF3, 0x6C, 0x25, 0xA9, 0x12, 0x38, 0x9A, 0xBF, 0xF8, 0x09, 0x1C, 0x75, 0x93, 0x03, 0xD2

You can use this to generate a copy-pastable line

ripe -g --aes --length 128 | sed -E 's/(..)/0x\1, /g' | tr -d '\n' | sed 's/, $//'

which will produce desired output like:

0x82, 0xF3, 0x6C, 0x25, 0xA9, 0x12, 0x38, 0x9A, 0xBF, 0xF8, 0x09, 0x1C, 0x75, 0x93, 0x03, 0xD2

This will now go in to the key register.

CLI

CLI tool provide ability to generate new licenses and validate existing license. Each CLI tool's version is linked directly with your version of key register.

See dedicated README

Issue New License

./license-manager --issue --licensee john-citizen --period 3600 --authority sample-license-authority [--signature <signature>] [--additional-payload <some string>] 

Validate License

./license-manager --validate license.file [--signature <signature>]

The validate checks for the following things:

  • The license was issued by authorised license issuing authority
  • License has been tampered with
  • The license is still valid
  • In case of signed license, the signature is valid

License Format

Licenses generated using License++ are base64 encoded JSON. They look like as follows:

{
    "authority_signature":"632DBBF8BC35A2CAA8CBC2952615839F86A40965A00D6F7420BEFF3DA1D35B9E360B5781D326AD6853991BB31452290FF3415C788255B33D391373A4AA9590E0849C8649FCFC98A6DC827DE2CE61AF15DE21E62E069CE1DB20C72352E6C15A825C0A8140CE42FE7B56C1A53981B3598EEE3AD4EDDD07461269AFC2C8B25B4BDD0C7E6A92986E2F0EAEC5E7C4C673C47AB25B3EE46EF0F3B9C8120865B63E68A505DBC2E85F0646BDF3FD082CA62BB647A0BEFF34E0C7CCE40BD84EABFEA7D902A26D33ADA01F75E7291EC35472B4ED328E0E3AE654E85AAEAEB3FFC9E5A7DE4CB08C9ADAC803367DC2845821E0C310BA26EA26DB3196A65445528AABF45888F6",
    "expiry_date":1528386596,
    "issue_date":1515426596,
    "issuing_authority":"sample-license-authority",
    "licensee":"john-citizen",
    "licensee_signature":"61663531383163626334303566613461363362343232316632663764393638383A35574F4F4C466B532F7A4F79376446364F6155776C673D3D0D0A0D0A",
    "additional_payload":"SomeTestData"
}

Format Explained

Item Description
authority_signature Signature of the authority which prevents alteration in the license
expiry_date License expiry date epoch
issue_date License issue date epoch
issuing_authority ID of issuing authority as per key register
licensee Name of the license holder
licensee_signature If licensee signed this license this is encrypted against key provided in key register. All the licenses signed by licensee will be validated against it at validation time.
additional_payload Any string to be embedded into the license

License

Copyright (c) 2018-present @abumq (Majid Q.)

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

licensepp's People

Contributors

abumq avatar ignogueiras avatar majorerror avatar michaelmigliore avatar myd7349 avatar sgiurgiu avatar vkresch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

licensepp's Issues

depence is not available

https://github.com/amraynweb/cryptopp-pem is not available now!
Are you have any alternative?

security license

the problem is that if the license has expired, then you can change the system time ago and get a valid license

should be fixed?

can't create valid licenses

I have made a test license which first decodes JSON is. The Signature is an empty string
{"authority_signature":"","expiry_date":1612447411,"issue_date":1580911411

and validating the file fails with:
Failed to verify the licensing authority

Bunch of errors at the building phase of cryptopp_5_6_5

Following the indications found here: https://github.com/abumq/licensepp?tab=readme-ov-file#getting-started I tried to compile and build licensepp in Ubuntu 23.10 but got ad the building phase of cryptopp_5_6_5 a bunch of errors:

raphy@raohy:~$ git clone https://github.com/abumq/licensepp.git
Cloning into 'licensepp'...
remote: Enumerating objects: 740, done.
remote: Counting objects: 100% (269/269), done.
remote: Compressing objects: 100% (128/128), done.
remote: Total 740 (delta 145), reused 224 (delta 126), pack-reused 471
Receiving objects: 100% (740/740), 368.36 KiB | 5.05 MiB/s, done.
Resolving deltas: 100% (432/432), done.

raphy@raohy:~$ cd licensepp/

raphy@raohy:~/licensepp$ mkdir dependencies
raphy@raohy:~/licensepp$ cd dependencies/

raphy@raohy:~/licensepp/dependencies$ wget https://raw.githubusercontent.com/abumq/abumq.github.io/master/downloads/cryptocpp.tar.gz
--2024-04-18 11:55:01--  https://raw.githubusercontent.com/abumq/abumq.github.io/master/downloads/cryptocpp.tar.gz
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8002::154, 2606:50c0:8000::154, 2606:50c0:8003::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8002::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 4126569 (3,9M) [application/octet-stream]
Saving to: ‘cryptocpp.tar.gz’

cryptocpp.tar.gz                   100%[=============================================================>]   3,93M  --.-KB/s    in 0,1s    

2024-04-18 11:55:01 (41,1 MB/s) - ‘cryptocpp.tar.gz’ saved [4126569/4126569]

raphy@raohy:~/licensepp/dependencies$ tar xf cryptocpp.tar.gz
raphy@raohy:~/licensepp/dependencies$ cd cryptopp-CRYPTOPP_5_6_5/
raphy@raohy:~/licensepp/dependencies/cryptopp-CRYPTOPP_5_6_5$ wget https://raw.githubusercontent.com/abumq/abumq.github.io/master/downloads/pem_pack.zip
--2024-04-18 11:55:43--  https://raw.githubusercontent.com/abumq/abumq.github.io/master/downloads/pem_pack.zip
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 2606:50c0:8003::154, 2606:50c0:8000::154, 2606:50c0:8002::154, ...
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|2606:50c0:8003::154|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 20769 (20K) [application/zip]
Saving to: ‘pem_pack.zip’

pem_pack.zip                            100%[===============================================================================>]  20,28K  --.-KB/s    in 0,002s  

2024-04-18 11:55:44 (13,1 MB/s) - ‘pem_pack.zip’ saved [20769/20769]

raphy@raohy:~/licensepp/dependencies/cryptopp-CRYPTOPP_5_6_5$ unzip pem_pack.zip 
Archive:  pem_pack.zip
  inflating: pem-com.cpp             
  inflating: pem-rd.cpp              
  inflating: pem-wr.cpp              
  inflating: pem-test.cxx            
  inflating: pem-create-keys.sh      
  inflating: pem-verify-keys.sh      
  inflating: pem.h                   
  inflating: pem-com.h               


raphy@raohy:~/licensepp/dependencies/cryptopp-CRYPTOPP_5_6_5$ cmake .
CMake Deprecation Warning at CMakeLists.txt:7 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The C compiler identification is GNU 12.3.0
-- The CXX compiler identification is GNU 13.2.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED
-- Performing Test COMPILER_OPT_ARCH_NATIVE_SUPPORTED - Success
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Compiler: 
-- Flags:  -march=native
-- Build type: RelWithDebInfo
-- The following OPTIONAL packages have been found:

 * Threads

-- Configuring done (0.6s)
-- Generating done (0.0s)
-- Build files have been written to: /home/raphy/licensepp/dependencies/cryptopp-CRYPTOPP_5_6_5


raphy@raohy:~/licensepp/dependencies/cryptopp-CRYPTOPP_5_6_5$ make
g++ -DNDEBUG -g2 -O2 -fPIC -m64 -pipe -c cryptlib.cpp
In file included from filters.h:22,
                 from cryptlib.cpp:20:
algparam.h: In destructor ‘virtual CryptoPP::AlgorithmParametersBase::~AlgorithmParametersBase()’:
algparam.h:404:45: warning: ‘bool std::uncaught_exception()’ is deprecated: use 'std::uncaught_exceptions()' instead [-Wdeprecated-declarations]
  404 |                 if (!std::uncaught_exception())
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/13/ext/concurrence.h:34,
                 from /usr/include/c++/13/bits/shared_ptr_base.h:62,
                 from /usr/include/c++/13/bits/shared_ptr.h:53,
                 from /usr/include/c++/13/memory:80,
                 from stdcpp.h:10,
                 from cryptlib.h:87,
                 from cryptlib.cpp:18:
/usr/include/c++/13/exception:122:8: note: declared here
  122 |   bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
      |        ^~~~~~~~~~~~~~~~~~
g++ -DNDEBUG -g2 -O2 -fPIC -m64 -pipe -c cpu.cpp
g++ -DNDEBUG -g2 -O2 -fPIC -m64 -pipe -c integer.cpp
In file included from nbtheory.h:11,
                 from integer.cpp:21:
algparam.h: In destructor ‘virtual CryptoPP::AlgorithmParametersBase::~AlgorithmParametersBase()’:
algparam.h:404:45: warning: ‘bool std::uncaught_exception()’ is deprecated: use 'std::uncaught_exceptions()' instead [-Wdeprecated-declarations]
  404 |                 if (!std::uncaught_exception())
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/13/ext/concurrence.h:34,
                 from /usr/include/c++/13/bits/shared_ptr_base.h:62,
                 from /usr/include/c++/13/bits/shared_ptr.h:53,
                 from /usr/include/c++/13/memory:80,
                 from stdcpp.h:10,
                 from cryptlib.h:87,
                 from integer.h:15,
                 from integer.cpp:18:
/usr/include/c++/13/exception:122:8: note: declared here
  122 |   bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
      |        ^~~~~~~~~~~~~~~~~~
g++ -DNDEBUG -g2 -O2 -fPIC -m64 -pipe -c 3way.cpp
g++ -DNDEBUG -g2 -O2 -fPIC -m64 -pipe -c adler32.cpp
g++ -DNDEBUG -g2 -O2 -fPIC -m64 -pipe -c algebra.cpp
g++ -DNDEBUG -g2 -O2 -fPIC -m64 -pipe -c algparam.cpp
In file included from algparam.cpp:7:
algparam.h: In destructor ‘virtual CryptoPP::AlgorithmParametersBase::~AlgorithmParametersBase()’:
algparam.h:404:45: warning: ‘bool std::uncaught_exception()’ is deprecated: use 'std::uncaught_exceptions()' instead [-Wdeprecated-declarations]
  404 |                 if (!std::uncaught_exception())
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/13/ext/concurrence.h:34,
                 from /usr/include/c++/13/bits/shared_ptr_base.h:62,
                 from /usr/include/c++/13/bits/shared_ptr.h:53,
                 from /usr/include/c++/13/memory:80,
                 from stdcpp.h:10,
                 from cryptlib.h:87,
                 from algparam.h:12:
/usr/include/c++/13/exception:122:8: note: declared here
  122 |   bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
      |        ^~~~~~~~~~~~~~~~~~
g++ -DNDEBUG -g2 -O2 -fPIC -m64 -pipe -c arc4.cpp
g++ -DNDEBUG -g2 -O2 -fPIC -m64 -pipe -c asn.cpp
In file included from filters.h:22,
                 from asn.h:10,
                 from asn.cpp:8:
algparam.h: In destructor ‘virtual CryptoPP::AlgorithmParametersBase::~AlgorithmParametersBase()’:
algparam.h:404:45: warning: ‘bool std::uncaught_exception()’ is deprecated: use 'std::uncaught_exceptions()' instead [-Wdeprecated-declarations]
  404 |                 if (!std::uncaught_exception())
      |                      ~~~~~~~~~~~~~~~~~~~~~~~^~
In file included from /usr/include/c++/13/ext/concurrence.h:34,
                 from /usr/include/c++/13/bits/shared_ptr_base.h:62,
                 from /usr/include/c++/13/bits/shared_ptr.h:53,
                 from /usr/include/c++/13/memory:80,
                 from stdcpp.h:10,
                 from cryptlib.h:87,
                 from asn.h:9:
/usr/include/c++/13/exception:122:8: note: declared here
  122 |   bool uncaught_exception() _GLIBCXX_USE_NOEXCEPT __attribute__ ((__pure__));
      |        ^~~~~~~~~~~~~~~~~~
asn.cpp: In function ‘size_t CryptoPP::DERLengthEncode(BufferedTransformation&, lword)’:
asn.cpp:22:24: error: reference to ‘byte’ is ambiguous
   22 |                 bt.Put(byte(length));
      |                        ^~~~
In file included from /usr/include/c++/13/bits/memory_resource.h:38,
                 from /usr/include/c++/13/string:58,
                 from stdcpp.h:9:
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
In file included from pch.h:13,
                 from asn.cpp:3:
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:27:24: error: reference to ‘byte’ is ambiguous
   27 |                 bt.Put(byte(BytePrecision(length) | 0x80));
      |                        ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:31:32: error: reference to ‘byte’ is ambiguous
   31 |                         bt.Put(byte(length >> (j-1)*8));
      |                                ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp: In function ‘bool CryptoPP::BERLengthDecode(BufferedTransformation&, lword&, bool&)’:
asn.cpp:40:9: error: reference to ‘byte’ is ambiguous
   40 |         byte b;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:42:21: error: ‘b’ was not declared in this scope; did you mean ‘bt’?
   42 |         if (!bt.Get(b))
      |                     ^
      |                     bt
asn.cpp:45:15: error: ‘b’ was not declared in this scope; did you mean ‘bt’?
   45 |         if (!(b & 0x80))
      |               ^
      |               bt
asn.cpp: In function ‘void CryptoPP::BERDecodeNull(BufferedTransformation&)’:
asn.cpp:95:9: error: reference to ‘byte’ is ambiguous
   95 |         byte b;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:96:21: error: ‘b’ was not declared in this scope
   96 |         if (!in.Get(b) || b != TAG_NULL)
      |                     ^
asn.cpp: At global scope:
asn.cpp:104:63: error: reference to ‘byte’ is ambiguous
  104 | size_t DEREncodeOctetString(BufferedTransformation &bt, const byte *str, size_t strLen)
      |                                                               ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp: In function ‘size_t CryptoPP::DEREncodeOctetString(BufferedTransformation&, const int*, size_t)’:
asn.cpp:108:16: error: invalid conversion from ‘const int*’ to ‘byte’ {aka ‘unsigned char’} [-fpermissive]
  108 |         bt.Put(str, strLen);
      |                ^~~
      |                |
      |                const int*
cryptlib.h:1385:33: note:   initializing argument 1 of ‘size_t CryptoPP::BufferedTransformation::Put(byte, bool)’
 1385 |                 size_t Put(byte inByte, bool blocking=true)
      |                            ~~~~~^~~~~~
asn.cpp: In function ‘size_t CryptoPP::BERDecodeOctetString(BufferedTransformation&, SecByteBlock&)’:
asn.cpp:119:9: error: reference to ‘byte’ is ambiguous
  119 |         byte b;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:120:21: error: ‘b’ was not declared in this scope; did you mean ‘bt’?
  120 |         if (!bt.Get(b) || b != OCTET_STRING)
      |                     ^
      |                     bt
asn.cpp: In function ‘size_t CryptoPP::BERDecodeOctetString(BufferedTransformation&, BufferedTransformation&)’:
asn.cpp:135:9: error: reference to ‘byte’ is ambiguous
  135 |         byte b;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:136:21: error: ‘b’ was not declared in this scope; did you mean ‘bt’?
  136 |         if (!bt.Get(b) || b != OCTET_STRING)
      |                     ^
      |                     bt
asn.cpp: At global scope:
asn.cpp:147:80: error: reference to ‘byte’ is ambiguous
  147 | size_t DEREncodeTextString(BufferedTransformation &bt, const std::string &str, byte asnTag)
      |                                                                                ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:147:80: error: ‘byte’ has not been declared
  147 | size_t DEREncodeTextString(BufferedTransformation &bt, const std::string &str, byte asnTag)
      |                                                                                ^~~~
asn.cpp: In function ‘size_t CryptoPP::DEREncodeTextString(BufferedTransformation&, const std::string&, int)’:
asn.cpp:151:23: error: ISO C++ forbids declaration of ‘type name’ with no type [-fpermissive]
  151 |         bt.Put((const byte *)str.data(), str.size());
      |                       ^~~~
asn.cpp:151:17: error: expected primary-expression before ‘const’
  151 |         bt.Put((const byte *)str.data(), str.size());
      |                 ^~~~~
asn.cpp:151:17: error: expected ‘)’ before ‘const’
  151 |         bt.Put((const byte *)str.data(), str.size());
      |                ~^~~~~
      |                 )
asn.cpp: At global scope:
asn.cpp:155:74: error: reference to ‘byte’ is ambiguous
  155 | size_t BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte asnTag)
      |                                                                          ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:155:74: error: ‘byte’ has not been declared
  155 | size_t BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte asnTag)
      |                                                                          ^~~~
asn.cpp: In function ‘size_t CryptoPP::BERDecodeTextString(BufferedTransformation&, std::string&, int)’:
asn.cpp:157:9: error: reference to ‘byte’ is ambiguous
  157 |         byte b;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:158:21: error: ‘b’ was not declared in this scope; did you mean ‘bt’?
  158 |         if (!bt.Get(b) || b != asnTag)
      |                     ^
      |                     bt
asn.cpp: At global scope:
asn.cpp:173:61: error: reference to ‘byte’ is ambiguous
  173 | size_t DEREncodeBitString(BufferedTransformation &bt, const byte *str, size_t strLen, unsigned int unusedBits)
      |                                                             ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp: In function ‘size_t CryptoPP::DEREncodeBitString(BufferedTransformation&, const int*, size_t, unsigned int)’:
asn.cpp:177:17: error: reference to ‘byte’ is ambiguous
  177 |         bt.Put((byte)unusedBits);
      |                 ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:178:16: error: invalid conversion from ‘const int*’ to ‘byte’ {aka ‘unsigned char’} [-fpermissive]
  178 |         bt.Put(str, strLen);
      |                ^~~
      |                |
      |                const int*
cryptlib.h:1385:33: note:   initializing argument 1 of ‘size_t CryptoPP::BufferedTransformation::Put(byte, bool)’
 1385 |                 size_t Put(byte inByte, bool blocking=true)
      |                            ~~~~~^~~~~~
asn.cpp: In function ‘size_t CryptoPP::BERDecodeBitString(BufferedTransformation&, SecByteBlock&, unsigned int&)’:
asn.cpp:184:9: error: reference to ‘byte’ is ambiguous
  184 |         byte b;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:185:21: error: ‘b’ was not declared in this scope; did you mean ‘bt’?
  185 |         if (!bt.Get(b) || b != BIT_STRING)
      |                     ^
      |                     bt
asn.cpp:192:9: error: reference to ‘byte’ is ambiguous
  192 |         byte unused;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:193:21: error: ‘unused’ was not declared in this scope
  193 |         if (!bt.Get(unused))
      |                     ^~~~~~
asn.cpp:195:22: error: ‘unused’ was not declared in this scope
  195 |         unusedBits = unused;
      |                      ^~~~~~
asn.cpp: In function ‘void CryptoPP::DERReencode(BufferedTransformation&, BufferedTransformation&)’:
asn.cpp:204:9: error: reference to ‘byte’ is ambiguous
  204 |         byte tag;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:205:21: error: ‘tag’ was not declared in this scope
  205 |         source.Peek(tag);
      |                     ^~~
asn.cpp: In static member function ‘static void CryptoPP::OID::EncodeValue(CryptoPP::BufferedTransformation&, CryptoPP::word32)’:
asn.cpp:222:25: error: reference to ‘byte’ is ambiguous
  222 |                 bt.Put((byte)(0x80 | ((v >> i) & 0x7f)));
      |                         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:223:17: error: reference to ‘byte’ is ambiguous
  223 |         bt.Put((byte)(v & 0x7f));
      |                 ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp: In static member function ‘static size_t CryptoPP::OID::DecodeValue(CryptoPP::BufferedTransformation&, CryptoPP::word32&)’:
asn.cpp:228:9: error: reference to ‘byte’ is ambiguous
  228 |         byte b;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:233:29: error: ‘b’ was not declared in this scope
  233 |                 if (!bt.Get(b))
      |                             ^
asn.cpp:239:22: error: ‘b’ was not declared in this scope
  239 |                 v += b & 0x7f;
      |                      ^
asn.cpp: In member function ‘void CryptoPP::OID::DEREncode(CryptoPP::BufferedTransformation&) const’:
asn.cpp:249:18: error: reference to ‘byte’ is ambiguous
  249 |         temp.Put(byte(m_values[0] * 40 + m_values[1]));
      |                  ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp: In member function ‘void CryptoPP::OID::BERDecode(CryptoPP::BufferedTransformation&)’:
asn.cpp:259:9: error: reference to ‘byte’ is ambiguous
  259 |         byte b;
      |         ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:260:21: error: ‘b’ was not declared in this scope; did you mean ‘bt’?
  260 |         if (!bt.Get(b) || b != OBJECT_IDENTIFIER)
      |                     ^
      |                     bt
asn.cpp:267:21: error: ‘b’ was not declared in this scope; did you mean ‘bt’?
  267 |         if (!bt.Get(b))
      |                     ^
      |                     bt
asn.cpp:272:23: error: ‘b’ was not declared in this scope; did you mean ‘bt’?
  272 |         m_values[0] = b / 40;
      |                       ^
      |                       bt
asn.cpp: At global scope:
asn.cpp:301:37: error: reference to ‘byte’ is ambiguous
  301 | void EncodedObjectFilter::Put(const byte *inString, size_t length)
      |                                     ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:301:6: error: no declaration matches ‘void CryptoPP::EncodedObjectFilter::Put(const int*, size_t)’
  301 | void EncodedObjectFilter::Put(const byte *inString, size_t length)
      |      ^~~~~~~~~~~~~~~~~~~
asn.h:216:14: note: candidate is: ‘void CryptoPP::EncodedObjectFilter::Put(const byte*, size_t)’
  216 |         void Put(const byte *inString, size_t length);
      |              ^~~
asn.h:202:7: note: ‘class CryptoPP::EncodedObjectFilter’ defined here
  202 | class EncodedObjectFilter : public Filter
      |       ^~~~~~~~~~~~~~~~~~~
asn.cpp:381:71: error: reference to ‘byte’ is ambiguous
  381 | BERGeneralDecoder::BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag)
      |                                                                       ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:381:71: error: ‘byte’ has not been declared
  381 | BERGeneralDecoder::BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag)
      |                                                                       ^~~~
asn.cpp:381:1: error: no declaration matches ‘CryptoPP::BERGeneralDecoder::BERGeneralDecoder(CryptoPP::BufferedTransformation&, int)’
  381 | BERGeneralDecoder::BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag)
      | ^~~~~~~~~~~~~~~~~
asn.h:234:20: note: candidates are: ‘constexpr CryptoPP::BERGeneralDecoder::BERGeneralDecoder(const CryptoPP::BERGeneralDecoder&)’
  234 | class CRYPTOPP_DLL BERGeneralDecoder : public Store
      |                    ^~~~~~~~~~~~~~~~~
asn.h:238:18: note:                 ‘CryptoPP::BERGeneralDecoder::BERGeneralDecoder(CryptoPP::BERGeneralDecoder&, byte)’
  238 |         explicit BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag);
      |                  ^~~~~~~~~~~~~~~~~
asn.h:237:18: note:                 ‘CryptoPP::BERGeneralDecoder::BERGeneralDecoder(CryptoPP::BufferedTransformation&, byte)’
  237 |         explicit BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag);
      |                  ^~~~~~~~~~~~~~~~~
asn.h:234:20: note: ‘class CryptoPP::BERGeneralDecoder’ defined here
  234 | class CRYPTOPP_DLL BERGeneralDecoder : public Store
      |                    ^~~~~~~~~~~~~~~~~
asn.cpp:387:66: error: reference to ‘byte’ is ambiguous
  387 | BERGeneralDecoder::BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag)
      |                                                                  ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:387:66: error: ‘byte’ has not been declared
  387 | BERGeneralDecoder::BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag)
      |                                                                  ^~~~
asn.cpp:387:1: error: no declaration matches ‘CryptoPP::BERGeneralDecoder::BERGeneralDecoder(CryptoPP::BERGeneralDecoder&, int)’
  387 | BERGeneralDecoder::BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag)
      | ^~~~~~~~~~~~~~~~~
asn.h:234:20: note: candidates are: ‘constexpr CryptoPP::BERGeneralDecoder::BERGeneralDecoder(const CryptoPP::BERGeneralDecoder&)’
  234 | class CRYPTOPP_DLL BERGeneralDecoder : public Store
      |                    ^~~~~~~~~~~~~~~~~
asn.h:238:18: note:                 ‘CryptoPP::BERGeneralDecoder::BERGeneralDecoder(CryptoPP::BERGeneralDecoder&, byte)’
  238 |         explicit BERGeneralDecoder(BERGeneralDecoder &inQueue, byte asnTag);
      |                  ^~~~~~~~~~~~~~~~~
asn.h:237:18: note:                 ‘CryptoPP::BERGeneralDecoder::BERGeneralDecoder(CryptoPP::BufferedTransformation&, byte)’
  237 |         explicit BERGeneralDecoder(BufferedTransformation &inQueue, byte asnTag);
      |                  ^~~~~~~~~~~~~~~~~
asn.h:234:20: note: ‘class CryptoPP::BERGeneralDecoder’ defined here
  234 | class CRYPTOPP_DLL BERGeneralDecoder : public Store
      |                    ^~~~~~~~~~~~~~~~~
asn.cpp:393:6: error: variable or field ‘Init’ declared void
  393 | void BERGeneralDecoder::Init(byte asnTag)
      |      ^~~~~~~~~~~~~~~~~
asn.cpp:393:30: error: reference to ‘byte’ is ambiguous
  393 | void BERGeneralDecoder::Init(byte asnTag)
      |                              ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:430:1: error: reference to ‘byte’ is ambiguous
  430 | byte BERGeneralDecoder::PeekByte() const
      | ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:438:6: error: variable or field ‘CheckByte’ declared void
  438 | void BERGeneralDecoder::CheckByte(byte check)
      |      ^~~~~~~~~~~~~~~~~
asn.cpp:438:35: error: reference to ‘byte’ is ambiguous
  438 | void BERGeneralDecoder::CheckByte(byte check)
      |                                   ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:488:72: error: reference to ‘byte’ is ambiguous
  488 | DERGeneralEncoder::DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag)
      |                                                                        ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:488:72: error: ‘byte’ has not been declared
  488 | DERGeneralEncoder::DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag)
      |                                                                        ^~~~
asn.cpp:488:1: error: no declaration matches ‘CryptoPP::DERGeneralEncoder::DERGeneralEncoder(CryptoPP::BufferedTransformation&, int)’
  488 | DERGeneralEncoder::DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag)
      | ^~~~~~~~~~~~~~~~~
asn.h:271:20: note: candidates are: ‘CryptoPP::DERGeneralEncoder::DERGeneralEncoder(const CryptoPP::DERGeneralEncoder&)’
  271 | class CRYPTOPP_DLL DERGeneralEncoder : public ByteQueue
      |                    ^~~~~~~~~~~~~~~~~
asn.h:279:18: note:                 ‘CryptoPP::DERGeneralEncoder::DERGeneralEncoder(CryptoPP::DERGeneralEncoder&, byte)’
  279 |         explicit DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag /*= SEQUENCE | CONSTRUCTED*/);
      |                  ^~~~~~~~~~~~~~~~~
asn.h:278:18: note:                 ‘CryptoPP::DERGeneralEncoder::DERGeneralEncoder(CryptoPP::BufferedTransformation&, byte)’
  278 |         explicit DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag /*= SEQUENCE | CONSTRUCTED*/);
      |                  ^~~~~~~~~~~~~~~~~
asn.h:271:20: note: ‘class CryptoPP::DERGeneralEncoder’ defined here
  271 | class CRYPTOPP_DLL DERGeneralEncoder : public ByteQueue
      |                    ^~~~~~~~~~~~~~~~~
asn.cpp:495:67: error: reference to ‘byte’ is ambiguous
  495 | DERGeneralEncoder::DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag)
      |                                                                   ^~~~
/usr/include/c++/13/cstddef:69:14: note: candidates are: ‘enum class std::byte’
   69 |   enum class byte : unsigned char {};
      |              ^~~~
config.h:230:23: note:                 ‘typedef unsigned char byte’
  230 | typedef unsigned char byte;             // put in global namespace to avoid ambiguity with other byte typedefs
      |                       ^~~~
asn.cpp:495:67: error: ‘byte’ has not been declared
  495 | DERGeneralEncoder::DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag)
      |                                                                   ^~~~
asn.cpp:495:1: error: no declaration matches ‘CryptoPP::DERGeneralEncoder::DERGeneralEncoder(CryptoPP::DERGeneralEncoder&, int)’
  495 | DERGeneralEncoder::DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag)
      | ^~~~~~~~~~~~~~~~~
asn.h:271:20: note: candidates are: ‘CryptoPP::DERGeneralEncoder::DERGeneralEncoder(const CryptoPP::DERGeneralEncoder&)’
  271 | class CRYPTOPP_DLL DERGeneralEncoder : public ByteQueue
      |                    ^~~~~~~~~~~~~~~~~
asn.h:279:18: note:                 ‘CryptoPP::DERGeneralEncoder::DERGeneralEncoder(CryptoPP::DERGeneralEncoder&, byte)’
  279 |         explicit DERGeneralEncoder(DERGeneralEncoder &outQueue, byte asnTag /*= SEQUENCE | CONSTRUCTED*/);
      |                  ^~~~~~~~~~~~~~~~~
asn.h:278:18: note:                 ‘CryptoPP::DERGeneralEncoder::DERGeneralEncoder(CryptoPP::BufferedTransformation&, byte)’
  278 |         explicit DERGeneralEncoder(BufferedTransformation &outQueue, byte asnTag /*= SEQUENCE | CONSTRUCTED*/);
      |                  ^~~~~~~~~~~~~~~~~
asn.h:271:20: note: ‘class CryptoPP::DERGeneralEncoder’ defined here
  271 | class CRYPTOPP_DLL DERGeneralEncoder : public ByteQueue
      |                    ^~~~~~~~~~~~~~~~~
make: *** [GNUmakefile:784: asn.o] Error 1
raphy@raohy:~/licensepp/dependencies/cryptopp-CRYPTOPP_5_6_5$ 

Unable to build ...

Any thoughs on trying to build this?

 cmake -DCMAKE_INSTALL_PREFIX=/opt/licensepp ..
-- The C compiler identification is GNU 9.3.0
-- The CXX compiler identification is GNU 9.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
==> Static linking to Crypto++
CMake Error at /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find CryptoPP (missing: CRYPTOPP_LIBRARY) (found version "8.2.0")
Call Stack (most recent call first):
  /usr/share/cmake/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindCryptoPP.cmake:117 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:46 (find_package)


-- Configuring incomplete, errors occurred!

Question about usage!

i have been success compiled this library on macOS.
but, I have an usage question.

Does it can be work like this behavior.
if so, could you give me a hint?

thanks

Issued License does not contain authority's signature on Windows

In the definition of copy constructor and assignment operator of class License, I needed to add code lines for m_authoritySignature respectively. Are the following modifications valid?

License::License(const License& other):
    m_issueDate(other.m_issueDate),
    m_expiryDate(other.m_expiryDate),
    m_licensee(other.m_licensee),
    m_issuingAuthorityId(other.m_issuingAuthorityId),
    m_licenseeSignature(other.m_licenseeSignature),
+++ m_authoritySignature(other.m_authoritySignature)
{
}

License& License::operator=(License other)
{
    std::swap(m_issueDate, other.m_issueDate);
    std::swap(m_expiryDate, other.m_expiryDate);
    std::swap(m_licensee, other.m_licensee);
    std::swap(m_licenseeSignature, other.m_licenseeSignature);
    std::swap(m_issuingAuthorityId, other.m_issuingAuthorityId);
+++ std::swap(m_authoritySignature, other.m_authoritySignature);
    return *this;
}

Versioning issue?

Hi When I try to make CLI I get undefined references. Could this be a versioning issue? Thanks!

licensepp/cli$ make
g++ main.cc licensing/license-manager-key-register.cc -I/usr/local/lib -llicensepp -std=c++11 -O3 -o license-manager
/usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::base64Encode(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::encryptRSA(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::encryptAES(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::decryptRSA(std::__cxx11::basic_string<char, std::char_traits, std::allocator >&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, bool, bool, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::hexToString(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::base64Decode(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::signRSA(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::generateNewKeyabi:cxx11'
/usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::decryptAES(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&, bool, bool)' /usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to Ripe::stringToHex(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
/usr/bin/ld: /usr/local/lib/liblicensepp.so: undefined reference to `Ripe::verifyRSA(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&)'
collect2: error: ld returned 1 exit status
make: *** [Makefile:2: license-manager] Error 1

Installation links for Crypto++ down

The links in the README for the installation doesn't work anymore.

wget https://muflihun.github.io/downloads/cryptocpp.tar.gz
tar xf cryptocpp.tar.gz
cd cryptopp-CRYPTOPP_5_6_5
wget https://muflihun.github.io/downloads/pem_pack.zip
unzip pem_pack.zip
cmake .
make
make install

I can install Crypto++ with
sudo apt-get install libcrypto++-dev libcrypto++-doc libcrypto++-utils
but I can't seem to find pem_pack.zip. Any help would be appreciated. I'm using Ubuntu 18.04.

Error Compiling on Mac OS X Mojave - Clang 3.9

Hello! First of all congratulations for this awesome library. I'm trying it on linux and windows. I had to tweak the code a little to compile on both OSs so I'm going to share it if you want!

As for compiling on Mac OS X, i followed all your steps but got the following error when attempting to compile, do you know any solution?

Rodrigos-MacBook-Air-8:build rodrigo$ make
Scanning dependencies of target licensepp-lib
[ 10%] Building CXX object CMakeFiles/licensepp-lib.dir/src/external/Ripe.cc.o
In file included from /Users/rodrigo/Downloads/licensepp-master/src/external/Ripe.cc:26:
In file included from /Users/rodrigo/Downloads/cryptopp/pem.h:23:
In file included from /Users/rodrigo/Downloads/cryptopp/rsa.h:14:
/Users/rodrigo/Downloads/cryptopp/pkcspad.h:86:53: error: instantiation of variable 'CryptoPP::PKCS_DigestDecorationCryptoPP::SHA1::decoration'
required here, but no definition is available [-Werror,-Wundefined-var-template]
return HashIdentifier(PKCS_DigestDecoration::decoration, PKCS_DigestDecoration::length);
^
/Users/rodrigo/Downloads/cryptopp/pubkey.h:615:19: note: in instantiation of member function
'CryptoPP::PKCS1v15_SignatureMessageEncodingMethod::HashIdentifierLookup::HashIdentifierLookup2CryptoPP::SHA1::Lookup' requested here
return L::Lookup();
^
/Users/rodrigo/Downloads/licensepp-master/src/external/Ripe.cc:147:35: note: in instantiation of member function
'CryptoPP::TF_ObjectImplBase<CryptoPP::TF_VerifierBase, CryptoPP::TF_SignatureSchemeOptions<CryptoPP::TF_SS<CryptoPP::PKCS1v15,
CryptoPP::SHA1, CryptoPP::RSA, int>, CryptoPP::RSA, CryptoPP::PKCS1v15_SignatureMessageEncodingMethod, CryptoPP::SHA1>,
CryptoPP::RSAFunction>::GetHashIdentifier' requested here
RSASS<PKCS1v15,SHA>::Verifier verifier(publicKey);
^
/Users/rodrigo/Downloads/cryptopp/pkcspad.h:37:20: note: forward declaration of template entity is here
static const byte decoration[];
^
/Users/rodrigo/Downloads/cryptopp/pkcspad.h:86:53: note: add an explicit instantiation declaration to suppress this warning if
'CryptoPP::PKCS_DigestDecorationCryptoPP::SHA1::decoration' is explicitly instantiated in another translation unit
return HashIdentifier(PKCS_DigestDecoration::decoration, PKCS_DigestDecoration::length);
^
1 error generated.
make[2]: *** [CMakeFiles/licensepp-lib.dir/src/external/Ripe.cc.o] Error 1
make[1]: *** [CMakeFiles/licensepp-lib.dir/all] Error 2
make: *** [all] Error 2

repo cryptopp-pem not accessible

In the install instructions, the command

git clone https://github.com/amraynweb/cryptopp-pem.git

does not work, asking for a username/password.

compiling error on macOS!

macOS: 10.15.3
cmake: 3.16.5

I try to compile but get an error about Could NOT find CryptoPP issue.

thx

message

% cmake ..
-- The C compiler identification is AppleClang 11.0.0.11000033
-- The CXX compiler identification is AppleClang 11.0.0.11000033
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc
-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++
-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
==> Static linking to Crypto++
CMake Error at /Volumes/Developer/opt/macOS-10.15/cmake-3.16.5/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:146 (message):
  Could NOT find CryptoPP (missing: CRYPTOPP_ROOT_DIR CRYPTOPP_INCLUDE_DIR
  CRYPTOPP_LIBRARY)
Call Stack (most recent call first):
  /Volumes/Developer/opt/macOS-10.15/cmake-3.16.5/share/cmake-3.16/Modules/FindPackageHandleStandardArgs.cmake:393 (_FPHSA_FAILURE_MESSAGE)
  cmake/FindCryptoPP.cmake:117 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:46 (find_package)


-- Configuring incomplete, errors occurred!
See also "/Downloads/licensepp/build/CMakeFiles/CMakeOutput.log".

Build Issue with cmake and cryto++

Hi, When I'm executing the cmake command, I get a static linking issue of cmake and crypto++. Mentioning Explicitly, CryptoPP could not be found by cmake.
(missing: CRYPTOPP_ROOT_DIR CRYPTOPP_INCLUDE_DIR, CRYPTOPP_LIBRARY)

I have attached screenshot of the same.

Screenshot 2020-02-01 at 5 14 14 PM

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.