Re: [openssl-users] how to import external rsa public key in openssl.

2018-06-08 Thread Viktor Dukhovni
> On Jun 8, 2018, at 3:02 AM, Sangsub wrote: > > pem_base64:"MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAirjFSROMxZ9gW1AmX2nsO4zjs+mvXhdNJs/iQmUBBL6gUQEYlnbHopLMa1rnGeEZ46wp6dOtna3NpJby9xhfnAxIcqLbEk8BmSsjjoP9WC2KKQ8pc/nPdE8eU/iqU6IlwSKZscw2WPtgfLWrpXmDLWwmh/cTAKTfPfHBQH4X0ipcGcgw7QxYJAcjCaYSu

Re: [openssl-users] how to import external rsa public key in openssl.

2018-06-08 Thread Matt Caswell
On 08/06/18 11:29, Sangsub wrote: > char buf[2] = {0,}; > memcpy(buf, pStr, sizeof(buf)); > > out[i] = (unsigned char)strtol(buf, NULL, 16); This looks wrong. "buf" is not NUL terminated so strtol could give an incorrect result.

Re: [openssl-users] how to import external rsa public key in openssl.

2018-06-08 Thread Sangsub
Thanks Matt for your reply. The purpose I am doing this is to find the modulus and exponent in the RSA public key. My sample code and the current results are shown below. = void fnStr2Hex(char* out, char* in) { int data_len = strlen(

Re: [openssl-users] how to import external rsa public key in openssl.

2018-06-08 Thread Matt Caswell
On 08/06/18 08:02, Sangsub wrote: > > I would like to perform operations such as RSA signature verification > through an RSA public key file received from an external server. > Key values are given in der format or pem format as follows. > > der:"30820122300d06092a864886f70d01010105000382010f0

[openssl-users] how to import external rsa public key in openssl.

2018-06-08 Thread Sangsub
I would like to perform operations such as RSA signature verification through an RSA public key file received from an external server. Key values are given in der format or pem format as follows. der:"30820122300d06092a864886f70d01010105000382010f003082010a02820101008ab8c549138cc59f605b50265f69e