diff options
author | Trevor Norris <trev.norris@gmail.com> | 2014-12-15 19:57:28 -0800 |
---|---|---|
committer | Trevor Norris <trev.norris@gmail.com> | 2014-12-19 16:31:12 -0800 |
commit | ae6444dad925a18a66ee0b1db3936534dbf822f4 (patch) | |
tree | 8b2fbd96eb6899ebf1f52a0c8c1e3e7a801a2a56 /deps/openssl/openssl/doc/crypto/EVP_PKEY_sign.pod | |
parent | 4bba87050c2b8aa801d982e93ea767b3abdc2f17 (diff) | |
parent | 813114dab05231b71f3cdc4f5889b9833d9a1d06 (diff) | |
download | node-ae6444dad925a18a66ee0b1db3936534dbf822f4.tar.gz |
Merge branch 'v0.10' into merge-review2merge-review2
Reverted caeb6773 for being unable to port the change to deps/v8. The
change will be ported directly in a later commit.
Conflicts:
ChangeLog
configure
doc/api/child_process.markdown
doc/api/tls.markdown
doc/api/url.markdown
lib/assert.js
lib/child_process.js
lib/crypto.js
lib/dgram.js
lib/http.js
lib/net.js
lib/timers.js
lib/tls.js
src/node.cc
src/node.h
src/node.js
src/node_crypto.cc
src/node_version.h
test/common.js
test/simple/test-child-process-spawn-typeerror.js
tools/certdata.txt
Diffstat (limited to 'deps/openssl/openssl/doc/crypto/EVP_PKEY_sign.pod')
-rw-r--r-- | deps/openssl/openssl/doc/crypto/EVP_PKEY_sign.pod | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/deps/openssl/openssl/doc/crypto/EVP_PKEY_sign.pod b/deps/openssl/openssl/doc/crypto/EVP_PKEY_sign.pod index a044f2c13..21974b4b1 100644 --- a/deps/openssl/openssl/doc/crypto/EVP_PKEY_sign.pod +++ b/deps/openssl/openssl/doc/crypto/EVP_PKEY_sign.pod @@ -28,9 +28,14 @@ B<sig> and the amount of data written to B<siglen>. =head1 NOTES +EVP_PKEY_sign() does not hash the data to be signed, and therefore is +normally used to sign digests. For signing arbitrary messages, see the +L<EVP_DigestSignInit(3)|EVP_DigestSignInit(3)> and +L<EVP_SignInit(3)|EVP_SignInit(3)> signing interfaces instead. + After the call to EVP_PKEY_sign_init() algorithm specific control operations can be performed to set any appropriate parameters for the -operation. +operation (see L<EVP_PKEY_CTX_ctrl(3)|EVP_PKEY_CTX_ctrl(3)>). The function EVP_PKEY_sign() can be called more than once on the same context if several operations are performed using the same parameters. @@ -49,13 +54,17 @@ Sign data using RSA with PKCS#1 padding and SHA256 digest: #include <openssl/rsa.h> EVP_PKEY_CTX *ctx; + /* md is a SHA-256 digest in this example. */ unsigned char *md, *sig; - size_t mdlen, siglen; + size_t mdlen = 32, siglen; EVP_PKEY *signing_key; - /* NB: assumes signing_key, md and mdlen are already set up - * and that signing_key is an RSA private key + + /* + * NB: assumes signing_key and md are set up before the next + * step. signing_key must be an RSA private key and md must + * point to the SHA-256 digest to be signed. */ - ctx = EVP_PKEY_CTX_new(signing_key); + ctx = EVP_PKEY_CTX_new(signing_key, NULL /* no engine */); if (!ctx) /* Error occurred */ if (EVP_PKEY_sign_init(ctx) <= 0) @@ -83,6 +92,7 @@ Sign data using RSA with PKCS#1 padding and SHA256 digest: =head1 SEE ALSO L<EVP_PKEY_CTX_new(3)|EVP_PKEY_CTX_new(3)>, +L<EVP_PKEY_CTX_ctrl(3)|EVP_PKEY_CTX_ctrl(3)>, L<EVP_PKEY_encrypt(3)|EVP_PKEY_encrypt(3)>, L<EVP_PKEY_decrypt(3)|EVP_PKEY_decrypt(3)>, L<EVP_PKEY_verify(3)|EVP_PKEY_verify(3)>, |