pub struct PublicKey {
pub fingerprint_sha256: String,
pub algo: String,
pub principal_id: String,
pub added: UnixMillis,
pub last_used: Option<UnixMillis>,
pub expires: Option<UnixMillis>,
pub openssh: String,
}Expand description
A registered public key.
The fingerprint is the primary key, because that is what an SSH handshake gives the server: russh hands over the offered key, gunnar fingerprints it and looks it up. The SSH username is decorative (the ACL model).
Fields§
§fingerprint_sha256: StringOpenSSH’s SHA256:<base64> fingerprint.
algo: StringThe algorithm name as OpenSSH writes it: ssh-ed25519, ssh-rsa, …
principal_id: StringWhich principal this key authenticates.
added: UnixMillisWhen it was registered.
last_used: Option<UnixMillis>When it last authenticated, if ever.
expires: Option<UnixMillis>When it stops being accepted, if ever.
openssh: StringThe authorized_keys-style line it was registered from.
Kept because gunnar-policy needs the key material itself to verify
gpg.format=ssh commit signatures (the pre-receive gate), and a fingerprint cannot
verify a signature.
Implementations§
Source§impl PublicKey
impl PublicKey
Sourcepub fn is_valid_at(&self, now: UnixMillis) -> bool
pub fn is_valid_at(&self, now: UnixMillis) -> bool
Is this key still valid at now?
Trait Implementations§
Source§impl<'de> Deserialize<'de> for PublicKey
impl<'de> Deserialize<'de> for PublicKey
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
impl Eq for PublicKey
impl StructuralPartialEq for PublicKey
Auto Trait Implementations§
impl Freeze for PublicKey
impl RefUnwindSafe for PublicKey
impl Send for PublicKey
impl Sync for PublicKey
impl Unpin for PublicKey
impl UnsafeUnpin for PublicKey
impl UnwindSafe for PublicKey
Blanket Implementations§
impl<T> Allocation for T
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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