From 2c39859e8efb29f6233f9ef436d1512b30b93e31 Mon Sep 17 00:00:00 2001 From: Kushal Das Date: Fri, 27 Sep 2024 15:07:31 +0200 Subject: [PATCH] Updates docs for rust functions --- changelog.md | 2 ++ docs/rustimplementation.rst | 19 +++++++++++++------ docs/smartcard.rst | 13 +++++++++++++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index c33d124..ea66be0 100644 --- a/changelog.md +++ b/changelog.md @@ -2,6 +2,8 @@ ## [unreleased] +## [0.15.0] - 2024-09-26 + ### Fixed - Fixes #140, updates dependencies. diff --git a/docs/rustimplementation.rst b/docs/rustimplementation.rst index 0cbc191..c441559 100644 --- a/docs/rustimplementation.rst +++ b/docs/rustimplementation.rst @@ -43,17 +43,24 @@ In most cases you don't have to use these, but if you have a reason, feel free t >>> rjce.get_key_cipher_details(key.keyvalue) [('F4F388BBB194925AE301F844C52B42177857DD79', 'EdDSA', 256), ('102EBD23BD5D2D340FBBDE0ADFD1C55926648D2F', 'EdDSA', 256), ('85B67F139D835FA56BA703DB5A7A1560D46ED4F6', 'ECDH', 256)] -.. function:: update_primary_expiry_on_card(certdata: bytes, expiry: int, pin: bytes) -> bytes: +.. function:: update_subkeys_expiry_in_cert(certdata: bytes, fingerprints: List[str], expirytime: int, password: string) -> bytes: - This function updates the expiry date using the Yubikey and public key as `certdata`. You will have to pass the expiry as `int` number of seconds (after which the key will expire). + This function updates the expiry date of the given subkeys and returns the new certificate. - .. versionadded:: 0.15.0 +.. function:: revoke_uid_in_cert(certdata: bytes, uid: bytes, password: string) -> bytes: -.. function:: update_subkeys_expiry_on_card(certdata: bytes, fingerprints: List[str], expiry: int, pin: bytes) -> bytes: + Revokes the given UID in the key and returns the new key with the revoked UID. + + +.. function:: add_uid_in_cert(certdata: bytes, uid: bytes, password: string) -> bytes: + + Adds the given UID in the key and returns the new key. + +.. function:: update_password(certdata: bytes, password: str, newpass: str) -> bytes: + + Updates the password of the key to a new password and then returns the updated key. - This function updates the expiry date of the given subkeys using Yubikey (the primary key must be on the Yubikey). You will have to pass the expiry as `int` number of seconds (after which the key will expire). - .. versionadded:: 0.15.0 .. class:: Johnny(filepath) diff --git a/docs/smartcard.rst b/docs/smartcard.rst index 5e61ea4..577f6d6 100644 --- a/docs/smartcard.rst +++ b/docs/smartcard.rst @@ -130,6 +130,19 @@ Smartcard API Signs the given filepath and writes to output. Also requires the the public in `certdata` argument. For things like email, you would want to sign them in clear text. +.. function:: update_primary_expiry_on_card(certdata: bytes, expiry: int, pin: bytes) -> bytes: + + This function updates the expiry date using the Yubikey and public key as `certdata`. You will have to pass the expiry as `int` number of seconds (after which the key will expire). + + .. versionadded:: 0.15.0 + +.. function:: update_subkeys_expiry_on_card(certdata: bytes, fingerprints: List[str], expiry: int, pin: bytes) -> bytes: + + This function updates the expiry date of the given subkeys using Yubikey (the primary key must be on the Yubikey). You will have to pass the expiry as `int` number of seconds (after which the key will expire). + + .. versionadded:: 0.15.0 + + .. function:: upload_to_smartcard(certdata: bytes, pin: bytes, password: str, whichkeys: int) -> bool: Uploads the marked (via whichkeys argument) subkeys to the smartcard. Takes the whole certdata (from `Key.keyvalue`) in bytes, and the admin pin of the card, the password (as string) of