openpgp-card-sequoia: add wrapper fn for set_identity()
This commit is contained in:
parent
37a99b63cf
commit
5fbe9186cb
1 changed files with 16 additions and 0 deletions
|
@ -359,6 +359,8 @@ impl<'a> Open<'a> {
|
||||||
self.opt.manage_security_environment(for_operation, key_ref)
|
self.opt.manage_security_environment(for_operation, key_ref)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ----------
|
||||||
|
|
||||||
/// Get "Attestation Certificate (Yubico)"
|
/// Get "Attestation Certificate (Yubico)"
|
||||||
pub fn attestation_certificate(&mut self) -> Result<Vec<u8>, Error> {
|
pub fn attestation_certificate(&mut self) -> Result<Vec<u8>, Error> {
|
||||||
self.opt.attestation_certificate()
|
self.opt.attestation_certificate()
|
||||||
|
@ -369,6 +371,20 @@ impl<'a> Open<'a> {
|
||||||
self.opt.firmware_version()
|
self.opt.firmware_version()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Set "identity", Nitrokey Start specific (possible values: 0, 1, 2).
|
||||||
|
/// <https://docs.nitrokey.com/start/windows/multiple-identities.html>
|
||||||
|
///
|
||||||
|
/// A Nitrokey Start can present as 3 different virtual OpenPGP cards.
|
||||||
|
/// This command enables one of those virtual cards.
|
||||||
|
///
|
||||||
|
/// Each virtual card identity behaves like a separate, independent OpenPGP card.
|
||||||
|
pub fn set_identity(&mut self, id: u8) -> Result<(), Error> {
|
||||||
|
// FIXME: what is in the returned data - is it ever useful?
|
||||||
|
let _ = self.opt.set_identity(id)?;
|
||||||
|
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
// ----------
|
// ----------
|
||||||
|
|
||||||
pub fn public_key(&mut self, key_type: KeyType) -> Result<PublicKeyMaterial, Error> {
|
pub fn public_key(&mut self, key_type: KeyType) -> Result<PublicKeyMaterial, Error> {
|
||||||
|
|
Loading…
Reference in a new issue