pub struct IbctKey {
pub key_id: String,
pub key_bytes: Vec<u8>,
}Expand description
A key entry in the IBCT key set.
Multiple entries allow key rotation: old keys are kept until all in-flight tokens signed with them expire.
Serialize is hand-written and redacts key_bytes to "[REDACTED]" (mirroring the
Debug impl below); Deserialize is derived and reads the real key bytes untouched.
Fields§
§key_id: StringUnique key identifier. Embedded in the token so the verifier can look it up.
key_bytes: Vec<u8>HMAC-SHA256 signing key (raw bytes, hex-encoded in config).
Implementations§
Source§impl IbctKey
impl IbctKey
Sourcepub fn from_hex(
key_id: impl Into<String>,
hex_key: &str,
) -> Result<Self, FromHexError>
pub fn from_hex( key_id: impl Into<String>, hex_key: &str, ) -> Result<Self, FromHexError>
Construct an IbctKey from a hex-encoded signing key, as used by
[a2a] ibct_keys[].key_hex in config and by vault-resolved IBCT secrets
(ibct_signing_key_vault_ref).
§Errors
Returns hex::FromHexError if hex_key is not valid hex.
§Examples
use zeph_a2a::IbctKey;
let key = IbctKey::from_hex("k1", "68656c6c6f2d7365637265742d6b6579").unwrap();
assert_eq!(key.key_id, "k1");
assert!(IbctKey::from_hex("k1", "not-hex").is_err());Trait Implementations§
Source§impl<'de> Deserialize<'de> for IbctKey
impl<'de> Deserialize<'de> for IbctKey
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 IbctKey
impl RefUnwindSafe for IbctKey
impl Send for IbctKey
impl Sync for IbctKey
impl Unpin for IbctKey
impl UnsafeUnpin for IbctKey
impl UnwindSafe for IbctKey
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