summaryrefslogtreecommitdiff
path: root/openssl/src/pkey.rs
diff options
context:
space:
mode:
authorPhilipp Keck <git@philippkeck.de>2017-01-03 14:48:46 +0100
committerGitHub <noreply@github.com>2017-01-03 14:48:46 +0100
commit1767cd5464c18c37730eddeba6f74dc5721c7bf1 (patch)
tree77f470f7d898c1fde9d91557e0e8904f4f522f52 /openssl/src/pkey.rs
parentcfb2539ed45fd11cec1af850256078ec494d8987 (diff)
downloadrust-openssl-1767cd5464c18c37730eddeba6f74dc5721c7bf1.zip
Pointer from PKey docs to sign module.
Could even add a link, but I don't know how. Someone who wants to use OpenSSL to compute an HMAC won't find a "hmac" module and won't find HMACs in the "hash" module. Unless the person knows that HMACs are used to "sign" messages (the usual term in this context would be "authenticate"), they will probably use the search function and look for "hmac", then they'll find this method. So it's helpful to include a pointer to the right API to use. Without such a pointer, the API user is left with a seemingly useless Pkey instance. Similar pointers could be helpful from the other creator methods in this file. And/or from the top-level documentation or the hash documentation towards the sign module. Another idea would be a trivial `hmac` module with a few helper functions that internally just use Pkey. If many users who just want a simple HMAC value can use that API, there are fewer dependencies on `Pkey` and `sign`, which is probably a good thing.
Diffstat (limited to 'openssl/src/pkey.rs')
-rw-r--r--openssl/src/pkey.rs1
1 files changed, 1 insertions, 0 deletions
diff --git a/openssl/src/pkey.rs b/openssl/src/pkey.rs
index 7f031244..6973154f 100644
--- a/openssl/src/pkey.rs
+++ b/openssl/src/pkey.rs
@@ -117,6 +117,7 @@ impl PKey {
}
/// Creates a new `PKey` containing an HMAC key.
+ /// Note: To compute HMAC values, use the `sign` module.
pub fn hmac(key: &[u8]) -> Result<PKey, ErrorStack> {
unsafe {
assert!(key.len() <= c_int::max_value() as usize);