Skip to content

Commit 04f5c63

Browse files
committed
2026-02-26 20:50 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbssl/evppkey.c * contrib/hbssl/hbssl.hbx + added new PRG function EVP_PKEY_get_encoded_public_key( <pKey> ) -> <cPubKeyData>
1 parent bf20288 commit 04f5c63

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

ChangeLog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
Entries may not always be in chronological/commit order.
88
See license at the end of file. */
99

10+
2026-02-26 20:50 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
11+
* contrib/hbssl/evppkey.c
12+
* contrib/hbssl/hbssl.hbx
13+
+ added new PRG function
14+
EVP_PKEY_get_encoded_public_key( <pKey> ) -> <cPubKeyData>
15+
1016
2026-02-16 23:30 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
1117
* contrib/gtqtc/gtqtc.hbp
1218
! give HB_WITH_QT higher priority then the general setting

contrib/hbssl/evppkey.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,31 @@ HB_FUNC( EVP_PKEY_BITS )
210210
hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
211211
}
212212

213+
HB_FUNC( EVP_PKEY_GET_ENCODED_PUBLIC_KEY )
214+
{
215+
if( hb_EVP_PKEY_is( 1 ) )
216+
{
217+
EVP_PKEY * pkey = hb_EVP_PKEY_par( 1 );
218+
219+
if( pkey )
220+
{
221+
unsigned char * pubkey_val;
222+
size_t pubkey_len;
223+
224+
pubkey_len = EVP_PKEY_get1_encoded_public_key( pkey, &pubkey_val );
225+
if( pubkey_len != 0 )
226+
{
227+
hb_retclen( ( char * ) pubkey_val, pubkey_len );
228+
OPENSSL_free( pubkey_val );
229+
}
230+
else
231+
hb_retc_null();
232+
}
233+
}
234+
else
235+
hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
236+
}
237+
213238
HB_FUNC( EVP_PKEY_ASSIGN )
214239
{
215240
if( hb_EVP_PKEY_is( 1 ) )

contrib/hbssl/hbssl.hbx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ DYNAMIC EVP_PKEY_decrypt_init
182182
DYNAMIC EVP_PKEY_encrypt
183183
DYNAMIC EVP_PKEY_encrypt_init
184184
DYNAMIC EVP_PKEY_free
185+
DYNAMIC EVP_PKEY_get_encoded_public_key
185186
DYNAMIC EVP_PKEY_new
186187
DYNAMIC EVP_PKEY_sign
187188
DYNAMIC EVP_PKEY_sign_init

0 commit comments

Comments
 (0)