Steven Fackler
7ce0835b74
Implement Clone for PKey
2019-10-01 18:45:10 -07:00
Sebastian Sturm
bdede43afe
Added support for Ed25519 and Ed448 signatures
2019-08-16 11:15:04 +02:00
Steven Fackler
2024379f17
Clean up seal/open a bit
2019-04-23 20:21:43 -07:00
Steven Fackler
7eee39f1ec
Rustfmt
2019-02-22 10:14:15 -07:00
Bastian Köcher
75bf48368d
Return `PKey<Private>` from `private_key_from_der`
2018-04-04 14:58:52 +02:00
Steven Fackler
d49e496940
Remove a last couple features
2018-03-19 20:41:08 +00:00
Flakebi
0860115156
Make it possible to use cmac
...
This adds Signer::new_without_digest to create Signers which don't have
a digest (like cmac, which is based on aes).
As openssl supports cmac since version 1.1.0, the functions are behind
the ossl110 feature.
This allows building CMAC/OMAC1 and the EAX AEAD on top of this library.
2018-03-19 21:02:46 +01:00
Steven Fackler
40e59db37c
Rename Oid to Id
2018-03-11 13:29:01 -07:00
Bastian Köcher
7fe3fabf24
Switches to new type wrapper for RsaPssSaltlen
2018-03-10 00:27:15 +01:00
Bastian Köcher
b0ea53184d
Switches to newtype wrapper for Oid
2018-03-08 12:24:37 +01:00
Bastian Köcher
9a8a1c752b
Adds `PKeyRef::get_id` to get the OID of a key
2018-03-07 18:42:13 +01:00
Ansley Peduru
d3169a565e
Add HMAC to Pkey docs
2018-01-24 09:53:28 -05:00
Ansley Peduru
6552a9cbfd
Print the public key in PKey example
2018-01-23 22:43:53 -05:00
Ansley Peduru
b9eace6569
Fix import in pkey docs
2018-01-07 14:17:03 -05:00
Ansley Peduru
33ec3a5784
Missing colon
2018-01-07 14:15:17 -05:00
Ansley Peduru
15420eb44a
Add Pkey docs
2018-01-07 14:13:17 -05:00
Steven Fackler
3c19702299
Rename key serialization/deserialization methods
...
Also document their specific formats.
Closes #502
2018-01-06 13:27:44 -08:00
Steven Fackler
d207897458
Parameterize keys over what they contain
...
Closes #790
2017-12-30 21:53:39 -08:00
Steven Fackler
2adf2cf12b
Remove deprecated APIs
2017-12-25 22:09:27 -07:00
Steven Fackler
bbae793eb3
Upgrade bitflags to 1.0
...
Closes #756
2017-12-25 19:38:11 -07:00
Paul Florence
0bae121e12
Added a macro that wraps foreign type, and impl Send and Sync for both,
...
the borrowed type and the owned one.
Replaced all invocation of `foreign_type` by `foreign_type_and_impl_send_sync`.
2017-11-10 10:05:52 -05:00
johnthagen
b5bb8de4f2
Convert try! usage to ?
2017-10-03 17:44:02 -04:00
Steven Fackler
bcd0dcafcb
Rustfmt
2017-07-15 21:46:11 -07:00
Steven Fackler
575e682da3
Add PKey::private_key_from_der
2017-06-23 21:04:13 -07:00
Steven Fackler
67b5fd1c97
Support public key decode from DER
...
Closes #629
2017-05-06 16:40:33 -07:00
Andrew Osmond
e6a6ebb87d
Add new EC/PKEY methods to permit deriving shared secrets.
2017-04-10 15:40:36 -04:00
Steven Fackler
19f3b8a11a
Support PKCS#8 private key deserialization
...
Closes #581
2017-02-14 19:37:25 -08:00
Steven Fackler
12ae31ad47
Switch to foreign_types
2017-02-03 23:03:35 -08:00
Brian Chin
4900d3fe5d
Fixed constant names from openssl/rsa.h
...
Fixed PKeyCtxRef method that didn't need to be mutable.
Added non-mutable accessors for PKeyCtxRef for Signer and Verifier.
2017-01-31 11:59:59 -08:00
Brian Chin
302ee77d32
Adding suggestions from review.
2017-01-30 16:51:10 -08:00
Brian Chin
588fd33552
Testing first version that works with signer.
2017-01-30 15:04:44 -08:00
Steven Fackler
e2f1569500
Tweak layout a little bit
2017-01-03 12:35:52 -08:00
Philipp Keck
1767cd5464
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.
2017-01-03 14:48:46 +01:00
Steven Fackler
6794a45d60
Rename ec_key to ec
2016-11-14 22:37:01 +01:00
Steven Fackler
0d0b5080e2
Rename new_by_curve_name to from_curve_name
2016-11-13 20:21:44 +00:00
Steven Fackler
7dbef567e6
Remove some stray manual impls
2016-11-13 18:00:42 +00:00
Steven Fackler
ccef9e339d
Macroise from_pem
2016-11-13 17:56:48 +00:00
Steven Fackler
b0415f466c
Macroise to_der
2016-11-13 16:52:19 +00:00
Steven Fackler
387e78257b
Support serialization of encrypted private keys
...
Switch to PEM_write_bio_PKCS8PrivateKey since the other function outputs
nonstandard PEM when encrypting.
2016-11-13 16:09:52 +00:00
Steven Fackler
2a8923c050
Macro-implement private_key_to_pem
2016-11-13 15:12:50 +00:00
Steven Fackler
08e0c4ca90
Some serialization support for EcKey
2016-11-13 15:02:38 +00:00
Steven Fackler
b14d68f715
Drop bits to u32
2016-11-12 11:14:05 +00:00
Steven Fackler
9b5c62b053
Add PKey::bits
2016-11-12 11:00:15 +00:00
Steven Fackler
6b7279eb52
Consistently support both PEM and DER encodings
...
Closes #500
2016-11-11 20:10:10 +00:00
Steven Fackler
15490a43e3
Add EcKey <-> PKey conversions
...
Closes #499
2016-11-11 19:17:38 +00:00
Steven Fackler
32cbed0782
PKey <-> DH conversions
...
Closes #498
2016-11-11 19:04:54 +00:00
Steven Fackler
609a09ebb9
Add PKey::dsa
...
Closes #501
2016-11-11 18:52:37 +00:00
Steven Fackler
8ad1e5565b
Remove set_rsa
...
PKey is reference counted so allowing mutation is unsound
2016-11-05 18:49:09 -07:00
Steven Fackler
01ae978db0
Get rid of Ref
...
There's unfortunately a rustdoc bug that causes all methods implemented
for any Ref<T> to be inlined in the deref methods section :(
2016-11-04 17:16:59 -07:00
Lionel Flandrin
9ea27c12b9
Add method to encode a public key as a DER blob
2016-11-01 17:34:21 +01:00