/* This Source Code Form is subject to the terms of the Mozilla Public *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use authenticator::{
authenticatorservice::{AuthenticatorService, RegisterArgs, SignArgs},
crypto::COSEAlgorithm,
ctap2::server::{
AuthenticationExtensionsClientInputs, AuthenticationExtensionsPRFInputs,
AuthenticationExtensionsPRFValues, HMACGetSecretInput, PublicKeyCredentialDescriptor,
PublicKeyCredentialParameters, PublicKeyCredentialUserEntity, RelyingParty,
ResidentKeyRequirement, Transport, UserVerificationRequirement,
},
statecallback::StateCallback,
Pin, StatusPinUv, StatusUpdate,
}; use getopts::Options; use rand::{thread_rng, RngCore}; use std::sync::mpsc::{channel, RecvError}; use std::{env, thread};
let args: Vec<String> = env::args().collect(); let program = args[0].clone();
let rp_id = "example.com".to_string();
letmut opts = Options::new();
opts.optflag("h", "help", "print this help menu").optopt( "t", "timeout", "timeout in seconds", "SEC",
);
opts.optflag("h", "help", "print this help menu");
opts.optflag( "", "hmac-secret", "Return hmac-secret outputs instead of prf outputs (i.e., do not prefix and hash the inputs)",
); let matches = match opts.parse(&args[1..]) {
Ok(m) => m,
Err(f) => panic!("{}", f.to_string()),
}; if matches.opt_present("help") {
print_usage(&program, opts); return;
}
letmut manager =
AuthenticatorService::new().expect("The auth service should initialize safely");
manager.add_u2f_usb_hid_platform_transports();
let timeout_ms = match matches.opt_get_default::<u64>("timeout", 25) {
Ok(timeout_s) => {
println!("Using {}s as the timeout", &timeout_s);
timeout_s * 1_000
}
Err(e) => {
println!("{e}");
print_usage(&program, opts); return;
}
};
let attestation_object; let (register_tx, register_rx) = channel(); let callback = StateCallback::new(Box::new(move |rv| {
register_tx.send(rv).unwrap();
}));
println!();
println!("*********************************************************************");
println!("Asking a security key to sign now, with the data from the register...");
println!("*********************************************************************");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.