| 1 | extern crate sshkeysrust-analyzer cargo sshkeys 0.3.4 sshkeys/; |
| 2 | |
| 3 | fn mainrust-analyzer cargo sshkeys 0.3.4 main().() { |
| 4 | let cert = sshkeysrust-analyzer cargo sshkeys 0.3.4 crate/::Certificaterust-analyzer cargo sshkeys 0.3.4 cert/Certificate#::from_pathrust-analyzer cargo sshkeys 0.3.4 cert/impl#[Certificate]from_path().("examples/id_ed25519-cert.pub").unwraprust-analyzer cargo core https://github.com/rust-lang/rust/library/core result/impl#[`Result<T, E>`]unwrap().(); |
| 5 | |
| 6 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Type: {} {}", cert.key_typerust-analyzer cargo sshkeys 0.3.4 cert/Certificate#key_type..namerust-analyzer cargo sshkeys 0.3.4 keytype/KeyType#name., cert.cert_typerust-analyzer cargo sshkeys 0.3.4 cert/Certificate#cert_type.); |
| 7 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Public key: {}", cert.keyrust-analyzer cargo sshkeys 0.3.4 cert/Certificate#key.); |
| 8 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Signing CA: {}", cert.signature_keyrust-analyzer cargo sshkeys 0.3.4 cert/Certificate#signature_key.); |
| 9 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Key ID: {}", cert.key_idrust-analyzer cargo sshkeys 0.3.4 cert/Certificate#key_id.); |
| 10 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Serial: {}", cert.serialrust-analyzer cargo sshkeys 0.3.4 cert/Certificate#serial.); |
| 11 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Valid from {} to {}", cert.valid_afterrust-analyzer cargo sshkeys 0.3.4 cert/Certificate#valid_after., cert.valid_beforerust-analyzer cargo sshkeys 0.3.4 cert/Certificate#valid_before.); |
| 12 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Principals:"); |
| 13 | for p in cert.valid_principalsrust-analyzer cargo sshkeys 0.3.4 cert/Certificate#valid_principals. { |
| 14 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("\t{}", p); |
| 15 | } |
| 16 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Critical Options:"); |
| 17 | for (name, value) in cert.critical_optionsrust-analyzer cargo sshkeys 0.3.4 cert/Certificate#critical_options. { |
| 18 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("\t{} {}", name, value); |
| 19 | } |
| 20 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("Extensions:"); |
| 21 | for (name, _) in cert.extensionsrust-analyzer cargo sshkeys 0.3.4 cert/Certificate#extensions. { |
| 22 | printlnrust-analyzer cargo std https://github.com/rust-lang/rust/library/std macros/println!!("\t{}", name); |
| 23 | } |
| 24 | } |