feat: update pkcs11 piv
This commit is contained in:
@@ -14,7 +14,6 @@
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
||||
use security_framework::key::SecKey;
|
||||
use tracing::instrument;
|
||||
|
||||
use native_pkcs11_traits::{Backend, KeyAlgorithm, PrivateKey, PublicKey, SignatureAlgorithm};
|
||||
@@ -28,7 +27,7 @@ pub enum Algorithm {
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct YubikeyPivPrivateKey {
|
||||
sec_key: SecKey,
|
||||
// sec_key: SecKey,
|
||||
label: String,
|
||||
public_key_hash: Vec<u8>,
|
||||
algorithm: KeyAlgorithm,
|
||||
@@ -99,13 +98,14 @@ impl PrivateKey for YubikeyPivPrivateKey {
|
||||
&self,
|
||||
_backend: &dyn Backend,
|
||||
) -> P11Result<Option<Box<dyn PublicKey>>> {
|
||||
// TODO ...
|
||||
Ok(None)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct YubikeyPivPublicKey {
|
||||
pub sec_key: SecKey,
|
||||
// pub sec_key: SecKey,
|
||||
pub label: String,
|
||||
der: Vec<u8>,
|
||||
public_key_hash: Vec<u8>,
|
||||
@@ -157,11 +157,12 @@ impl PublicKey for YubikeyPivPublicKey {
|
||||
// if !result {
|
||||
// return Err("verify failed")?;
|
||||
// }
|
||||
// TODO ...
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn delete(self: Box<Self>) {
|
||||
let _ = self.sec_key.delete();
|
||||
// yubikey-piv-pkcs11 just cannot delete public key
|
||||
}
|
||||
|
||||
fn algorithm(&self) -> KeyAlgorithm {
|
||||
|
||||
Reference in New Issue
Block a user