pub struct CDNSKEY(/* private fields */);
Available on crate feature
dnssec
only.Expand description
RRSIG is really a derivation of the original SIG record data. See SIG for more documentation
Methods from Deref<Target = DNSKEY>§
sourcepub fn zone_key(&self) -> bool
pub fn zone_key(&self) -> bool
RFC 4034, DNSSEC Resource Records, March 2005
2.1.1. The Flags Field
Bit 7 of the Flags field is the Zone Key flag. If bit 7 has value 1,
then the DNSKEY record holds a DNS zone key, and the DNSKEY RR's
owner name MUST be the name of a zone. If bit 7 has value 0, then
the DNSKEY record holds some other type of DNS public key and MUST
NOT be used to verify RRSIGs that cover RRsets.
Bits 0-6 and 8-14 are reserved: these bits MUST have value 0 upon
creation of the DNSKEY RR and MUST be ignored upon receipt.
sourcepub fn secure_entry_point(&self) -> bool
pub fn secure_entry_point(&self) -> bool
RFC 4034, DNSSEC Resource Records, March 2005
2.1.1. The Flags Field
Bit 15 of the Flags field is the Secure Entry Point flag, described
in [RFC3757]. If bit 15 has value 1, then the DNSKEY record holds a
key intended for use as a secure entry point. This flag is only
intended to be a hint to zone signing or debugging software as to the
intended use of this DNSKEY record; validators MUST NOT alter their
behavior during the signature validation process in any way based on
the setting of this bit. This also means that a DNSKEY RR with the
SEP bit set would also need the Zone Key flag set in order to be able
to generate signatures legally. A DNSKEY RR with the SEP set and the
Zone Key flag not set MUST NOT be used to verify RRSIGs that cover
RRsets.
sourcepub fn revoke(&self) -> bool
pub fn revoke(&self) -> bool
RFC 5011, Trust Anchor Update, September 2007
RFC 5011 Trust Anchor Update September 2007
7. IANA Considerations
The IANA has assigned a bit in the DNSKEY flags field (see Section 7
of [RFC4034]) for the REVOKE bit (8).
sourcepub fn algorithm(&self) -> Algorithm
pub fn algorithm(&self) -> Algorithm
RFC 4034, DNSSEC Resource Records, March 2005
2.1.3. The Algorithm Field
The Algorithm field identifies the public key's cryptographic
algorithm and determines the format of the Public Key field. A list
of DNSSEC algorithm types can be found in Appendix A.1
sourcepub fn public_key(&self) -> &[u8] ⓘ
pub fn public_key(&self) -> &[u8] ⓘ
RFC 4034, DNSSEC Resource Records, March 2005
2.1.4. The Public Key Field
The Public Key Field holds the public key material. The format
depends on the algorithm of the key being stored and is described in
separate documents.
sourcepub fn to_digest(
&self,
name: &Name,
digest_type: DigestType
) -> ProtoResult<Digest>
Available on crate features openssl
or ring
only.
pub fn to_digest( &self, name: &Name, digest_type: DigestType ) -> ProtoResult<Digest>
openssl
or ring
only.Creates a message digest for this DNSKEY record.
5.1.4. The Digest Field
The DS record refers to a DNSKEY RR by including a digest of that
DNSKEY RR.
The digest is calculated by concatenating the canonical form of the
fully qualified owner name of the DNSKEY RR with the DNSKEY RDATA,
and then applying the digest algorithm.
digest = digest_algorithm( DNSKEY owner name | DNSKEY RDATA);
"|" denotes concatenation
DNSKEY RDATA = Flags | Protocol | Algorithm | Public Key.
The size of the digest may vary depending on the digest algorithm and
DNSKEY RR size. As of the time of this writing, the only defined
digest algorithm is SHA-1, which produces a 20 octet digest.
§Arguments
name
- the label of of the DNSKEY record.digest_type
- theDigestType
with which to create the message digest.
sourcepub fn calculate_key_tag(&self) -> ProtoResult<u16>
pub fn calculate_key_tag(&self) -> ProtoResult<u16>
The key tag is calculated as a hash to more quickly lookup a DNSKEY.
RFC 2535, Domain Name System Security Extensions, March 1999
RFC 2535 DNS Security Extensions March 1999
4.1.6 Key Tag Field
The "key Tag" is a two octet quantity that is used to efficiently
select between multiple keys which may be applicable and thus check
that a public key about to be used for the computationally expensive
effort to check the signature is possibly valid. For algorithm 1
(MD5/RSA) as defined in [RFC 2537], it is the next to the bottom two
octets of the public key modulus needed to decode the signature
field. That is to say, the most significant 16 of the least
significant 24 bits of the modulus in network (big endian) order. For
all other algorithms, including private algorithms, it is calculated
as a simple checksum of the KEY RR as described in Appendix C.
Appendix C: Key Tag Calculation
The key tag field in the SIG RR is just a means of more efficiently
selecting the correct KEY RR to use when there is more than one KEY
RR candidate available, for example, in verifying a signature. It is
possible for more than one candidate key to have the same tag, in
which case each must be tried until one works or all fail. The
following reference implementation of how to calculate the Key Tag,
for all algorithms other than algorithm 1, is in ANSI C. It is coded
for clarity, not efficiency. (See section 4.1.6 for how to determine
the Key Tag of an algorithm 1 key.)
/* assumes int is at least 16 bits
first byte of the key tag is the most significant byte of return
value
second byte of the key tag is the least significant byte of
return value
*/
int keytag (
unsigned char key[], /* the RDATA part of the KEY RR */
unsigned int keysize, /* the RDLENGTH */
)
{
long int ac; /* assumed to be 32 bits or larger */
for ( ac = 0, i = 0; i < keysize; ++i )
ac += (i&1) ? key[i] : key[i]<<8;
ac += (ac>>16) & 0xFFFF;
return ac & 0xFFFF;
}
Trait Implementations§
source§impl BinEncodable for CDNSKEY
impl BinEncodable for CDNSKEY
source§fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
Write the type to the stream
source§impl<'de> Deserialize<'de> for CDNSKEY
impl<'de> Deserialize<'de> for CDNSKEY
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 CDNSKEY
impl PartialEq for CDNSKEY
source§impl RecordData for CDNSKEY
impl RecordData for CDNSKEY
source§fn try_from_rdata(data: RData) -> Result<Self, RData>
fn try_from_rdata(data: RData) -> Result<Self, RData>
Attempts to convert to this RecordData from the RData type, if it is not the correct type the original is returned
source§fn try_borrow(data: &RData) -> Option<&Self>
fn try_borrow(data: &RData) -> Option<&Self>
Attempts to borrow this RecordData from the RData type, if it is not the correct type the original is returned
source§fn record_type(&self) -> RecordType
fn record_type(&self) -> RecordType
Get the associated RecordType for the RecordData
source§fn into_rdata(self) -> RData
fn into_rdata(self) -> RData
Converts this RecordData into generic RecordData
impl Eq for CDNSKEY
impl StructuralPartialEq for CDNSKEY
Auto Trait Implementations§
impl Freeze for CDNSKEY
impl RefUnwindSafe for CDNSKEY
impl Send for CDNSKEY
impl Sync for CDNSKEY
impl Unpin for CDNSKEY
impl UnwindSafe for CDNSKEY
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
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.