diff --git a/NEXT.md b/NEXT.md index 074282b..1408631 100644 --- a/NEXT.md +++ b/NEXT.md @@ -1,8 +1,9 @@ # Next version changes ## This file contains changes that will be included in the next version that is released -v0.2.0 +v0.1.21 New: + - `Card.cert_url` - for retrieving certificate URL stored on the card, note that the URL returned can be empty or invalid, Changed: diff --git a/README.md b/README.md index c820bff..c867150 100644 --- a/README.md +++ b/README.md @@ -62,6 +62,7 @@ sh /start.sh echo 12345678 > pin opgpcard admin --card 0000:00000000 --admin-pin pin import no-passwd.pgp opgpcard admin --card 0000:00000000 --admin-pin pin name "John Doe" +opgpcard admin --card 0000:00000000 --admin-pin pin url "https://example.com/key.pgp" ``` ## Functions @@ -408,6 +409,7 @@ card = Card.open("0000:00000000") print(f"Card ident: {card.ident}") assert card.cardholder == "John Doe" +assert card.cert_url == "https://example.com/key.pgp" ``` Cards can be used for signing data: diff --git a/src/card.rs b/src/card.rs index f0ffeae..bb6f165 100644 --- a/src/card.rs +++ b/src/card.rs @@ -31,6 +31,12 @@ impl Card { .map(|name| String::from_utf8_lossy(name).into())) } + #[getter] + pub fn cert_url(&mut self) -> anyhow::Result { + let mut transaction = self.open.transaction()?; + Ok(transaction.url()?) + } + #[getter] pub fn ident(&mut self) -> anyhow::Result { let transaction = self.open.transaction()?;