Commit 9040594 1 parent cc7a758 commit 9040594 Copy full SHA for 9040594
File tree 2 files changed +24
-0
lines changed
2 files changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -38,3 +38,15 @@ The [rustls-pemfile](https://docs.rs/rustls-pemfile) crate can be used to parse
38
38
39
39
This crate does not provide any functionality for creating new certificates or keys. However,
40
40
the [ rcgen] ( https://docs.rs/rcgen ) crate can be used to create new certificates and keys.
41
+
42
+ ## Cloning private keys
43
+
44
+ This crate intentionally ** does not** implement ` Clone ` on private key types in
45
+ order to minimize the exposure of private key data in memory.
46
+
47
+ Since these types are immutable, if you find you're self wanting to clone them
48
+ it may be better to consider wrapping the ` PrivateKeyDer<'_> ` in a [ ` Rc ` ] ` or
49
+ [ ` Arc ` ] .
50
+
51
+ [ `Rc` ] : https://doc.rust-lang.org/std/rc/struct.Rc.html
52
+ [ `Arc` ] : https://doc.rust-lang.org/std/sync/struct.Arc.html
Original file line number Diff line number Diff line change 25
25
//!
26
26
//! This crate does not provide any functionality for creating new certificates or keys. However,
27
27
//! the [rcgen](https://docs.rs/rcgen) crate can be used to create new certificates and keys.
28
+ //!
29
+ //! ## Cloning private keys
30
+ //!
31
+ //! This crate intentionally **does not** implement `Clone` on private key types in
32
+ //! order to minimize the exposure of private key data in memory.
33
+ //!
34
+ //! Since these types are immutable, if you find you're self wanting to clone them
35
+ //! it may be better to consider wrapping the `PrivateKeyDer<'_>` in a [`Rc`]` or
36
+ //! [`Arc`].
37
+ //!
38
+ //! [`Rc`]: https://doc.rust-lang.org/std/rc/struct.Rc.html
39
+ //! [`Arc`]: https://doc.rust-lang.org/std/sync/struct.Arc.html
28
40
29
41
#![ cfg_attr( not( feature = "std" ) , no_std) ]
30
42
#![ warn( unreachable_pub, clippy:: use_self) ]
You can’t perform that action at this time.
0 commit comments