pub enum SecretGenPolicy {
PasswordRandom {
length: u8,
charset: Charset,
max_length: Option<u8>,
},
PreSharedKey {
length_bytes: u8,
},
Token {
length: u8,
prefix: Option<String>,
},
WireguardKeypair,
SshKeypair {
algo: SshAlgo,
},
TlsKeypair {
algo: TlsAlgo,
validity_days: u32,
},
}Variants§
PasswordRandom
A random password drawn from charset.
length is the requested length; max_length, when set, is a
structural cap imposed by the consumer (e.g. macOS’s legacy
VNC ARD-XOR scheme silently truncates beyond 16 bytes — pairing
length: 32 with max_length: Some(16) is a validator failure).
A pre-shared key — random bytes, length_bytes long, encoded as
base64 url-safe. Used for WireGuard PSKs and similar.
Token
A bearer token — random alphanumeric, length chars, with an
optional human-readable prefix (prefix: Some("pat_") →
pat_AbCdEf...).
WireguardKeypair
A WireGuard X25519 keypair. Materializes TWO secrets at once:
<path>.private and <path>.public, both base64 (32 bytes each).
SshKeypair
An SSH keypair (Ed25519 or RSA). Same dual-path materialization
as WireGuard: <path>.private (OpenSSH PEM), <path>.public
(ssh-ed25519 AAAA... comment line).
TlsKeypair
A self-signed TLS keypair, valid validity_days from generation.
Materializes <path>.key (PEM) + <path>.crt (PEM).
Implementations§
Source§impl SecretGenPolicy
impl SecretGenPolicy
Sourcepub fn backend_paths(&self) -> usize
pub fn backend_paths(&self) -> usize
How many distinct backend paths this policy materializes. Most policies are 1; keypair policies are 2.
Trait Implementations§
Source§impl Clone for SecretGenPolicy
impl Clone for SecretGenPolicy
Source§fn clone(&self) -> SecretGenPolicy
fn clone(&self) -> SecretGenPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecretGenPolicy
impl Debug for SecretGenPolicy
Source§impl<'de> Deserialize<'de> for SecretGenPolicy
impl<'de> Deserialize<'de> for SecretGenPolicy
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>,
impl Eq for SecretGenPolicy
Source§impl Hash for SecretGenPolicy
impl Hash for SecretGenPolicy
Source§impl PartialEq for SecretGenPolicy
impl PartialEq for SecretGenPolicy
Source§impl Serialize for SecretGenPolicy
impl Serialize for SecretGenPolicy
impl StructuralPartialEq for SecretGenPolicy
Auto Trait Implementations§
impl Freeze for SecretGenPolicy
impl RefUnwindSafe for SecretGenPolicy
impl Send for SecretGenPolicy
impl Sync for SecretGenPolicy
impl Unpin for SecretGenPolicy
impl UnsafeUnpin for SecretGenPolicy
impl UnwindSafe for SecretGenPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
key and return true if they are equal.