File: certificate.rs

package info (click to toggle)
rust-sshkeys 0.3.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 392 kB
  • sloc: makefile: 2
file content (24 lines) | stat: -rw-r--r-- 781 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
extern crate sshkeys;

fn main() {
    let cert = sshkeys::Certificate::from_path("examples/id_ed25519-cert.pub").unwrap();

    println!("Type: {} {}", cert.key_type.name, cert.cert_type);
    println!("Public key: {}", cert.key);
    println!("Signing CA: {}", cert.signature_key);
    println!("Key ID: {}", cert.key_id);
    println!("Serial: {}", cert.serial);
    println!("Valid from {} to {}", cert.valid_after, cert.valid_before);
    println!("Principals:");
    for p in cert.valid_principals {
        println!("\t{}", p);
    }
    println!("Critical Options:");
    for (name, value) in cert.critical_options {
        println!("\t{} {}", name, value);
    }
    println!("Extensions:");
    for (name, _) in cert.extensions {
        println!("\t{}", name);
    }
}