pub struct RootTag { /* private fields */ }Expand description
Root cryptographic tag with hierarchical derivation capability.
Implementations§
Source§impl RootTag
impl RootTag
Sourcepub fn new(hex: impl AsRef<str>) -> Result<Self>
pub fn new(hex: impl AsRef<str>) -> Result<Self>
Create from hex-encoded string with comprehensive validation.
Sourcepub fn generate() -> Result<Self>
pub fn generate() -> Result<Self>
Generate cryptographically secure root tag using OS RNG.
§Errors
Returns error if the OS RNG produces invalid entropy (catastrophic system failure).
Sourcepub fn derive_host_tag_bytes(&self, hostname: &str) -> [u8; 64]
pub fn derive_host_tag_bytes(&self, hostname: &str) -> [u8; 64]
Derive host-specific tag bytes using SHA3-512 (no heap allocation).
Sourcepub fn derive_host_tag(&self, hostname: &str) -> Vec<u8> ⓘ
pub fn derive_host_tag(&self, hostname: &str) -> Vec<u8> ⓘ
Derive host-specific tag using SHA3-512.
Sourcepub fn derive_artifact_tag_bytes(
&self,
hostname: &str,
artifact_id: &str,
) -> [u8; 64]
pub fn derive_artifact_tag_bytes( &self, hostname: &str, artifact_id: &str, ) -> [u8; 64]
Derive artifact-specific tag bytes using SHA3-512 (no heap allocation).
Sourcepub fn derive_artifact_tag_hex_into(
&self,
hostname: &str,
artifact_id: &str,
out: &mut [u8; 128],
)
pub fn derive_artifact_tag_hex_into( &self, hostname: &str, artifact_id: &str, out: &mut [u8; 128], )
Derive artifact-specific tag as lowercase hex bytes into caller-provided buffer.
This method performs no heap allocation.
Sourcepub fn derive_artifact_tag(&self, hostname: &str, artifact_id: &str) -> String
pub fn derive_artifact_tag(&self, hostname: &str, artifact_id: &str) -> String
Derive artifact-specific tag using SHA3-512.
Sourcepub fn hash_eq_ct(&self, other: &Self) -> bool
pub fn hash_eq_ct(&self, other: &Self) -> bool
Constant-time comparison of root tag hashes.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for RootTag
impl<'de> Deserialize<'de> for RootTag
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
Auto Trait Implementations§
impl Freeze for RootTag
impl RefUnwindSafe for RootTag
impl Send for RootTag
impl Sync for RootTag
impl Unpin for RootTag
impl UnsafeUnpin for RootTag
impl UnwindSafe for RootTag
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