Implement set_pso_enc_dec_key()
This commit is contained in:
parent
c205917759
commit
b90ee05f6d
3 changed files with 19 additions and 0 deletions
|
@ -430,6 +430,10 @@ impl Admin<'_, '_> {
|
||||||
self.oc.opt.set_resetting_code(pin)
|
self.oc.opt.set_resetting_code(pin)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn set_pso_enc_dec_key(&mut self, key: &[u8]) -> Result<(), Error> {
|
||||||
|
self.oc.opt.set_pso_enc_dec_key(key)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn reset_user_pin(&mut self, new: &[u8]) -> Result<(), Error> {
|
pub fn reset_user_pin(&mut self, new: &[u8]) -> Result<(), Error> {
|
||||||
self.oc.opt.reset_retry_counter_pw1(new, None)
|
self.oc.opt.reset_retry_counter_pw1(new, None)
|
||||||
}
|
}
|
||||||
|
|
|
@ -314,6 +314,7 @@ pub(crate) enum Tags {
|
||||||
GenerationTimeAuthentication,
|
GenerationTimeAuthentication,
|
||||||
// FIXME: +D1, D2
|
// FIXME: +D1, D2
|
||||||
ResettingCode,
|
ResettingCode,
|
||||||
|
PsoEncDecKey,
|
||||||
|
|
||||||
// OTHER
|
// OTHER
|
||||||
// 4.4.3.12 Private Key Template
|
// 4.4.3.12 Private Key Template
|
||||||
|
@ -422,6 +423,7 @@ impl From<Tags> for ShortTag {
|
||||||
Tags::GenerationTimeDecryption => [0xcf].into(),
|
Tags::GenerationTimeDecryption => [0xcf].into(),
|
||||||
Tags::GenerationTimeAuthentication => [0xd0].into(),
|
Tags::GenerationTimeAuthentication => [0xd0].into(),
|
||||||
Tags::ResettingCode => [0xd3].into(),
|
Tags::ResettingCode => [0xd3].into(),
|
||||||
|
Tags::PsoEncDecKey => [0xd5].into(),
|
||||||
|
|
||||||
// OTHER
|
// OTHER
|
||||||
// 4.4.3.12 Private Key Template
|
// 4.4.3.12 Private Key Template
|
||||||
|
|
|
@ -801,6 +801,19 @@ impl<'a> OpenPgpTransaction<'a> {
|
||||||
apdu::send_command(self.tx(), cmd, false)?.try_into()
|
apdu::send_command(self.tx(), cmd, false)?.try_into()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set AES key for symmetric decryption/encryption operations.
|
||||||
|
///
|
||||||
|
/// Optional DO (announced in Extended Capabilities) for
|
||||||
|
/// PSO:ENC/DEC with AES (32 bytes dec. in case of
|
||||||
|
/// AES256, 16 bytes dec. in case of AES128).
|
||||||
|
pub fn set_pso_enc_dec_key(&mut self, key: &[u8]) -> Result<(), Error> {
|
||||||
|
log::info!("OpenPgpTransaction: set_pso_enc_dec_key");
|
||||||
|
|
||||||
|
let fp_cmd = commands::put_data(Tags::PsoEncDecKey, key.to_vec());
|
||||||
|
|
||||||
|
apdu::send_command(self.tx(), fp_cmd, false)?.try_into()
|
||||||
|
}
|
||||||
|
|
||||||
// FIXME: optional DO for PSO:ENC/DEC with AES
|
// FIXME: optional DO for PSO:ENC/DEC with AES
|
||||||
|
|
||||||
/// Set UIF for PSO:CDS
|
/// Set UIF for PSO:CDS
|
||||||
|
|
Loading…
Reference in a new issue