Re: [openssl-users] RSA sign message

2016-07-20 Thread Gabriel Ivașcu
On Wed, Jul 20, 2016 at 12:19 AM, Dr. Stephen Henson  wrote:
>
> If you want to hash and sign the hash you should use EVP functions such as
>  EVP_DigestSign*() functions instead. If you already have the hash you can
> use RSA_sign (though EVP_PKEY_sign() is preferred) the type parameter in
> the NID of the digest algorithm, for SHA256 you use NID_sha256.

Indeed, NID_sha256 works great in my case, thank you!

I will have a look at EVP_DigestSign*() functions too.

Thanks,
Gabriel
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


Re: [openssl-users] RSA sign message

2016-07-19 Thread Dr. Stephen Henson
On Tue, Jul 19, 2016, Gabriel Iva??cu wrote:

> Hi,
> 
> I need to RSA sign a message using SHA256 as hash and PKCS1 v1.5 as padding.
> 
> I am however confused about the *type* parameter of RSA_sign function [0]
> 
> What is the value that I should use for *type* in my particular case?
> 

If you want to hash and sign the hash you should use EVP functions such as
 EVP_DigestSign*() functions instead. If you already have the hash you can
use RSA_sign (though EVP_PKEY_sign() is preferred) the type parameter in
the NID of the digest algorithm, for SHA256 you use NID_sha256.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users


[openssl-users] RSA sign message

2016-07-19 Thread Gabriel Ivașcu
Hi,

I need to RSA sign a message using SHA256 as hash and PKCS1 v1.5 as padding.

I am however confused about the *type* parameter of RSA_sign function [0]

What is the value that I should use for *type* in my particular case?

Thanks,
Gabriel

[0] https://www.openssl.org/docs/manmaster/crypto/RSA_sign.html
-- 
openssl-users mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-users