diff --git a/openpgp-card-sequoia/src/lib.rs b/openpgp-card-sequoia/src/lib.rs index d67fd25..8b7b07c 100644 --- a/openpgp-card-sequoia/src/lib.rs +++ b/openpgp-card-sequoia/src/lib.rs @@ -435,6 +435,9 @@ impl<'a> Card> { // --- optional private DOs (0101 - 0104) --- // --- login data (5e) --- + pub fn login_data(&mut self) -> Result { + Ok(String::from_utf8_lossy(&self.state.opt.login_data()?).to_string()) + } // --- URL (5f50) --- @@ -775,6 +778,10 @@ impl Card> { self.card().set_sex(sex) } + pub fn set_login_data(&mut self, login_data: &str) -> Result<(), Error> { + self.card().set_login(login_data.as_bytes()) + } + /// Set "hardholder" URL on the card. /// /// "The URL should contain a link to a set of public keys in OpenPGP format, related to