Reputation: 1
I am using the yubikey
Rust crate.
pub fn gen_key(
device: &mut YubiKey,
cipher: AlgorithmId,
slot: piv::SlotId,
) -> Result<SubjectPublicKeyInfoOwned, yubikey::Error> {
let gen_key = piv::generate(
device,
slot,
cipher,
yubikey::PinPolicy::Default,
yubikey::TouchPolicy::Never,
);
return gen_key;
}
I call this function with gen_key(&mut yubikey, cipher, SlotId::KeyManagement);
This is the output:
Ok(SubjectPublicKeyInfo { algorithm: AlgorithmIdentifier { oid: ObjectIdentifier(1.2.840.113549.1.1.1), parameters: Some(Any { tag: Tag(0x05: N
ULL), value: BytesOwned { length: Length(0), inner: [] } }) }, subject_public_key: BitString { unused_bits: 0, bit_length: 2160, inner: [48, 130, 1, 10, 2, 130, 1, 1, 0, 203, 89, 2
05, 39, 178, 180, 110, 40, 145, 47, 98, 1, 107, 135, 228, 37, 33, 227, 194, 181, 144, 215, 149, 213, 175, 208, 197, 237, 126, 149, 138, 230, 139, 16, 179, 202, 22, 19, 55, 199, 178
, 239, 102, 196, 193, 238, 46, 216, 185, 136, 118, 95, 52, 251, 143, 28, 74, 142, 56, 66, 226, 160, 113, 42, 251, 247, 129, 219, 233, 27, 171, 11, 210, 19, 179, 149, 128, 107, 133,
48, 71, 75, 41, 239, 7, 13, 225, 11, 58, 213, 117, 89, 153, 221, 211, 90, 255, 205, 23, 19, 60, 122, 196, 132, 122, 175, 249, 2, 141, 195, 182, 243, 220, 153, 161, 194, 208, 194,
29, 72, 41, 33, 20, 186, 14, 166, 109, 50, 195, 4, 71, 103, 238, 98, 230, 191, 194, 198, 126, 0, 146, 214, 210, 149, 40, 224, 43, 176, 68, 111, 197, 42, 135, 215, 109, 69, 228, 45,
120, 157, 118, 228, 237, 207, 0, 117, 250, 99, 204, 35, 95, 60, 228, 144, 164, 36, 107, 46, 160, 110, 31, 193, 118, 167, 2, 62, 78, 115, 3, 47, 19, 14, 1, 71, 212, 198, 148, 241,
208, 230, 195, 39, 95, 49, 227, 139, 89, 67, 94, 211, 230, 92, 195, 161, 156, 219, 97, 212, 106, 185, 131, 107, 137, 92, 79, 188, 80, 55, 83, 0, 218, 25, 145, 150, 223, 109, 129, 194, 203, 148, 134, 55, 114, 228, 215, 215, 96, 252, 25, 111, 80, 50, 89, 197, 233, 11, 2, 3, 1, 0, 1] } })
Upvotes: 0
Views: 64