Struct ed25519_dalek::pkcs8::spki::der::SecretDocument
pub struct SecretDocument(_);
Available on crate features
pkcs8
and zeroize
only.Expand description
Secret Document
type.
Useful for formats which represent potentially secret data, such as cryptographic keys.
This type provides additional hardening such as ensuring that the contents are zeroized-on-drop, and also using more restrictive file permissions when writing files to disk.
Implementations§
§impl SecretDocument
impl SecretDocument
pub fn to_bytes(&self) -> Zeroizing<Vec<u8, Global>>
pub fn to_bytes(&self) -> Zeroizing<Vec<u8, Global>>
Return an allocated ASN.1 DER serialization as a byte vector.
pub fn decode_msg<'a, T>(&'a self) -> Result<T, Error>where
T: Decode<'a>,
pub fn decode_msg<'a, T>(&'a self) -> Result<T, Error>where T: Decode<'a>,
Try to decode the inner ASN.1 DER message as the given type.
pub fn encode_msg<T>(msg: &T) -> Result<SecretDocument, Error>where
T: Encode,
pub fn encode_msg<T>(msg: &T) -> Result<SecretDocument, Error>where T: Encode,
Encode the provided type as ASN.1 DER.
Trait Implementations§
§impl Clone for SecretDocument
impl Clone for SecretDocument
§fn clone(&self) -> SecretDocument
fn clone(&self) -> SecretDocument
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl Debug for SecretDocument
impl Debug for SecretDocument
§impl From<Document> for SecretDocument
impl From<Document> for SecretDocument
§fn from(doc: Document) -> SecretDocument
fn from(doc: Document) -> SecretDocument
Converts to this type from the input type.
§impl TryFrom<&[u8]> for SecretDocument
impl TryFrom<&[u8]> for SecretDocument
§impl TryFrom<&PrivateKeyInfo<'_>> for SecretDocument
Available on crate feature alloc
only.
impl TryFrom<&PrivateKeyInfo<'_>> for SecretDocument
Available on crate feature
alloc
only.§fn try_from(private_key: &PrivateKeyInfo<'_>) -> Result<SecretDocument, Error>
fn try_from(private_key: &PrivateKeyInfo<'_>) -> Result<SecretDocument, Error>
Performs the conversion.
§impl TryFrom<PrivateKeyInfo<'_>> for SecretDocument
Available on crate feature alloc
only.
impl TryFrom<PrivateKeyInfo<'_>> for SecretDocument
Available on crate feature
alloc
only.§fn try_from(private_key: PrivateKeyInfo<'_>) -> Result<SecretDocument, Error>
fn try_from(private_key: PrivateKeyInfo<'_>) -> Result<SecretDocument, Error>
Performs the conversion.
impl ZeroizeOnDrop for SecretDocument
Auto Trait Implementations§
impl RefUnwindSafe for SecretDocument
impl Send for SecretDocument
impl Sync for SecretDocument
impl Unpin for SecretDocument
impl UnwindSafe for SecretDocument
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more