pub struct DsmKroot<'a>(pub &'a [u8]);
Expand description

DSM-KROOT message.

The DSM-KROOT message, as defined in Figure 7 of the OSNMA ICD.

Tuple Fields

0: &'a [u8]

Reference to a slice containing the DSM-KROOT message data.

Panics

This slice should be long enough to contain the full DSM-KROOT message. Otherwise the methods of DsmKroot may panic.

Implementations

Gives the number of DSM-KROOT blocks.

The number is computed according to the value of the NB_DK field and Table 7 in the OSNMA ICD.

If the NB_DK field contains a reserved value, None is returned.

Gives the value of the PKID (public key ID) field.

Gives the value of the CIDKR (KROOT chain ID) field.

Gives the value of the hash function field.

Gives the value of the MAC function field.

Gives the TESLA key size in bits.

The size is computed according to the value of the KS field and Table 10 in the OSNMA ICD.

If the KS field contains a reserved value, None is returned.

Gives the MAC tag size in bits.

The size is computed according to the value of the TS field and Table 11 in the OSNMA ICD.

If the TS field contains a reserved value, None is returned.

Gives the value of the MACLT (MAC look-up table) field.

Gives the KROOT week number.

This is the value of the WNK field.

Gives the KROOT time of week in hours.

This is the value of the TOWHK field.

Gives the value of the random pattern alpha.

The random pattern alpha is a 48-bit value. Here it is given in a u64.

Returns a slice reference to the KROOT in the DSM-KROOT message.

This is the contents of the KROOT field. The length of the returned slice depends on the TESLA key size.

Panics

Panics if the key size field in the DSM-KROOT message contains a reserved value.

Returns the ECDSA function used by this DSM-KROOT message.

The ECDSA function is guessed from the size of the ECDSA signature in the message.

Panics

Panics if the ECDSA function cannot be guessed because the size of the signature is neither 512 bits (for P-256) nor 1056 bits (for P-521).

Returns a slice reference to the ECDSA signature in the DSM-KROOT message.

This is the contents of the digital signature (DS) field. The length of the returned slice depend on the ECDSA function in use.

Panics

Panics if the ECDSA function cannot be guessed because the size of the signature is neither 512 bits (for P-256) nor 1056 bits (for P-521).

Gives the contents of the DSM-KROOT padding (P_DK) field.

Checks the contents of the padding field.

The contents are checked according to Eq. 7 in the OSNMA ICD.

If the contents are correct, this returns true. Otherwise, this returns false.

Checks the ECDSA signature.

This verifies that the ECDSA signature of the DSM-KROOT message is correct. The algorithm in Section 6.3 of the OSNMA ICD is followed.

Only P-256 signatures are supported.

Panics

Panics if the ECDSA signature cannot be serialized.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

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

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Converts self into T using Into<T>. Read more

Causes self to use its Binary implementation when Debug-formatted. Read more

Causes self to use its Display implementation when Debug-formatted. Read more

Causes self to use its LowerExp implementation when Debug-formatted. Read more

Causes self to use its LowerHex implementation when Debug-formatted. Read more

Causes self to use its Octal implementation when Debug-formatted. Read more

Causes self to use its Pointer implementation when Debug-formatted. Read more

Causes self to use its UpperExp implementation when Debug-formatted. Read more

Causes self to use its UpperHex implementation when Debug-formatted. Read more

Formats each item in a sequence. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Pipes by value. This is generally the method you want to use. Read more

Borrows self and passes that borrow into the pipe function. Read more

Mutably borrows self and passes that borrow into the pipe function. Read more

Borrows self, then passes self.borrow() into the pipe function. Read more

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more

Borrows self, then passes self.as_ref() into the pipe function.

Mutably borrows self, then passes self.as_mut() into the pipe function. Read more

Borrows self, then passes self.deref() into the pipe function.

Mutably borrows self, then passes self.deref_mut() into the pipe function. Read more

Should always be Self

Immutable access to a value. Read more

Mutable access to a value. Read more

Immutable access to the Borrow<B> of a value. Read more

Mutable access to the BorrowMut<B> of a value. Read more

Immutable access to the AsRef<R> view of a value. Read more

Mutable access to the AsMut<R> view of a value. Read more

Immutable access to the Deref::Target of a value. Read more

Mutable access to the Deref::Target of a value. Read more

Calls .tap() only in debug builds, and is erased in release builds.

Calls .tap_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow() only in debug builds, and is erased in release builds. Read more

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref() only in debug builds, and is erased in release builds. Read more

Calls .tap_ref_mut() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref() only in debug builds, and is erased in release builds. Read more

Calls .tap_deref_mut() only in debug builds, and is erased in release builds. Read more

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Attempts to convert self into T using TryInto<T>. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.