Commit Graph

9 Commits

Author SHA1 Message Date
Sertonix
37c0f0cf1a
Fix BioByteArray when char is not signed
char can be signed or unsigned depending on the arch and compiler flags. Use unsigned char explicitly to behave consistently.

Fixes 7078853573 Consolidate Bignum2ByteArray conversion implementations
2025-03-26 12:36:45 +00:00
Christian Hohnstaedt
778e5c2e3a Feature #313: Add JWK export
Export private and public keys as JWK.
2024-09-13 10:41:16 +02:00
Christian Hohnstaedt
7078853573 Consolidate Bignum2ByteArray conversion implementations
Unify the different implementations of Bignum-to-QByteArray
implementations by our BioByteArray class.

Also support alignment to a minimal bitsize.
2024-09-13 10:41:16 +02:00
Christian Hohnstaedt
e2e142e012 Add some moduletests 2023-10-12 23:58:00 +02:00
Christian Hohnstaedt
ab17dfd52f Simplify key checking algorithm
Since we dropped OpenSSL < 1.1.1 support, we can use
 EVP_PKEY_public_check() and EVP_PKEY_check()

Thanks to discussion in:
acb75afa6d
2023-05-16 09:49:46 +02:00
Christian Hohnstaedt
ef24c00c22 Minor fixes 2020-06-26 14:21:32 +02:00
Christian Hohnstaedt
9e52d99067 Fix destructor of BioByteArray to not overwrite ro data 2020-05-08 17:37:40 +02:00
Christian Hohnstaedt
d1c0970ea1 BioByteArray: Add size() method 2020-05-06 18:08:36 +02:00
Christian Hohnstaedt
ea453d4336 Encapsulate all BIOs in the BioByteArray class
If we have a QByteArray (ba) and must provide it to
a BIO* expecting OpenSSL function, the following
construct provides it: BioByteArray(ba).ro()
directly providing the QByteArray buffer as BIO

It also supports mixed writes:
  BIO_write(bba, buf, size)
  bba += QByteArray
2020-04-06 22:07:57 +02:00