pub struct KeyConfig {
    pub key_path: String,
    pub password: Option<String>,
    pub algorithm: String,
    pub signer_name: Option<String>,
    pub is_zone_signing_key: Option<bool>,
    pub is_zone_update_auth: Option<bool>,
}
Expand description

Key pair configuration for DNSSEC keys for signing a zone

Fields§

§key_path: String

file path to the key

§password: Option<String>

password to use to read the key

§algorithm: String

the type of key stored, see Algorithm

§signer_name: Option<String>

the name to use when signing records, e.g. ns.example.com

§is_zone_signing_key: Option<bool>

specify that this key should be used for signing a zone

§is_zone_update_auth: Option<bool>

specifies that this key can be used for dynamic updates in the zone

Implementations§

source§

impl KeyConfig

source

pub fn new( key_path: String, password: Option<String>, algorithm: Algorithm, signer_name: String, is_zone_signing_key: bool, is_zone_update_auth: bool ) -> Self

Available on crate feature dnssec only.

Return a new KeyConfig

Arguments
  • key_path - file path to the key
  • password - password to use to read the key
  • algorithm - the type of key stored, see Algorithm
  • signer_name - the name to use when signing records, e.g. ns.example.com
  • is_zone_signing_key - specify that this key should be used for signing a zone
  • is_zone_update_auth - specifies that this key can be used for dynamic updates in the zone
source

pub fn key_path(&self) -> &Path

path to the key file, either relative to the zone file, or a explicit from the root.

source

pub fn format(&self) -> ParseResult<KeyFormat>

Available on crate features dns-over-tls or dnssec only.

Converts key into

source

pub fn password(&self) -> Option<&str>

Returns the password used to read the key

source

pub fn algorithm(&self) -> ParseResult<Algorithm>

Available on crate feature dnssec only.

algorithm for for the key, see Algorithm for supported algorithms.

source

pub fn signer_name(&self) -> ParseResult<Option<Name>>

the signer name for the key, this defaults to the $ORIGIN aka zone name.

source

pub fn is_zone_signing_key(&self) -> bool

specifies that this key should be used to sign the zone

The public key for this must be trusted by a resolver to work. The key must have a private portion associated with it. It will be registered as a DNSKEY in the zone.

source

pub fn is_zone_update_auth(&self) -> bool

this is at least a public_key, and can be used for SIG0 dynamic updates.

it will be registered as a KEY record in the zone.

source

pub fn try_into_signer<N: IntoName>( &self, signer_name: N ) -> Result<SigSigner, String>

Available on crate feature dnssec only.

Tries to read the defined key into a Signer

Trait Implementations§

source§

impl Debug for KeyConfig

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for KeyConfig

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl PartialEq for KeyConfig

source§

fn eq(&self, other: &KeyConfig) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Eq for KeyConfig

source§

impl StructuralEq for KeyConfig

source§

impl StructuralPartialEq for KeyConfig

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

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,

§

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,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,