feat: debugging
This commit is contained in:
@@ -88,6 +88,7 @@ impl Backend for YubikeyPivBackend {
|
||||
fn find_all_certificates(
|
||||
&self,
|
||||
) -> P11Result<Vec<Box<dyn P11Certificate>>> {
|
||||
println!("[find_all_certificates]");
|
||||
let mut certs = vec![];
|
||||
self.run_with_yubikey(false, |yk| {
|
||||
let keys = yk.piv_keys()?;
|
||||
@@ -95,6 +96,7 @@ impl Backend for YubikeyPivBackend {
|
||||
let certificate_der = key.certificate().cert.to_der()?;
|
||||
let public_key_der = key.certificate().cert.tbs_certificate.subject_public_key_info.to_der()?;
|
||||
let algorithm_id = get_algorithm_id_by_certificate(key.certificate())?;
|
||||
println!(">>> {:?} {}", algorithm_id, &key.certificate().cert.tbs_certificate.subject);
|
||||
if algorithm_id == AlgorithmId::EccP256 || algorithm_id == AlgorithmId::EccP384 {
|
||||
let cert: Box<dyn P11Certificate> = Box::new(YubikeyPivCertificate::new(
|
||||
key.slot().to_string(),
|
||||
@@ -115,6 +117,7 @@ impl Backend for YubikeyPivBackend {
|
||||
&self,
|
||||
query: P11KeySearchOptions,
|
||||
) -> P11Result<Option<Arc<dyn P11PrivateKey>>> {
|
||||
println!("[find_private_key]");
|
||||
match query {
|
||||
KeySearchOptions::Label(label) => {
|
||||
println!(">>> find private key >>>: {}", label);
|
||||
@@ -132,6 +135,7 @@ impl Backend for YubikeyPivBackend {
|
||||
&self,
|
||||
query: P11KeySearchOptions,
|
||||
) -> P11Result<Option<Box<dyn P11PublicKey>>> {
|
||||
println!("[find_public_key]");
|
||||
match query {
|
||||
KeySearchOptions::Label(label) => {
|
||||
println!(">>> find public key >>>: {}", label);
|
||||
@@ -147,6 +151,7 @@ impl Backend for YubikeyPivBackend {
|
||||
fn find_all_private_keys(
|
||||
&self,
|
||||
) -> P11Result<Vec<Arc<dyn P11PrivateKey>>> {
|
||||
println!("[find_all_private_keys]");
|
||||
// TODO ...
|
||||
Ok(vec![])
|
||||
}
|
||||
@@ -154,6 +159,7 @@ impl Backend for YubikeyPivBackend {
|
||||
fn find_all_public_keys(
|
||||
&self,
|
||||
) -> P11Result<Vec<Arc<dyn P11PublicKey>>> {
|
||||
println!("[find_all_public_keys]");
|
||||
// self.find_all_certificates().map(|c|{
|
||||
// c.as_mut().map(|c| )
|
||||
// })
|
||||
|
||||
Reference in New Issue
Block a user