Enum trust_dns_proto::rr::dnssec::KeyFormat
source · pub enum KeyFormat {
Der,
Pem,
Pkcs8,
}
Available on crate feature
dnssec
and (crate features openssl
or ring
) only.Expand description
The format of the binary key
Variants§
Der
A der encoded key
Pem
A pem encoded key, the default of OpenSSL
Pkcs8
Pkcs8, a pkcs8 formatted private key
Implementations§
source§impl KeyFormat
impl KeyFormat
sourcepub fn decode_key(
self,
bytes: &[u8],
password: Option<&str>,
algorithm: Algorithm
) -> DnsSecResult<KeyPair<Private>>
pub fn decode_key( self, bytes: &[u8], password: Option<&str>, algorithm: Algorithm ) -> DnsSecResult<KeyPair<Private>>
Decode private key
sourcepub fn generate_and_encode(
self,
algorithm: Algorithm,
password: Option<&str>
) -> DnsSecResult<Vec<u8>>
pub fn generate_and_encode( self, algorithm: Algorithm, password: Option<&str> ) -> DnsSecResult<Vec<u8>>
Generate a new key and encode to the specified format
sourcepub fn encode_key(
self,
key_pair: &KeyPair<Private>,
password: Option<&str>
) -> DnsSecResult<Vec<u8>>
👎Deprecated
pub fn encode_key( self, key_pair: &KeyPair<Private>, password: Option<&str> ) -> DnsSecResult<Vec<u8>>
Encode private key
Trait Implementations§
source§impl PartialEq for KeyFormat
impl PartialEq for KeyFormat
impl Copy for KeyFormat
impl Eq for KeyFormat
impl StructuralEq for KeyFormat
impl StructuralPartialEq for KeyFormat
Auto Trait Implementations§
impl RefUnwindSafe for KeyFormat
impl Send for KeyFormat
impl Sync for KeyFormat
impl Unpin for KeyFormat
impl UnwindSafe for KeyFormat
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.