Skip to content

Commit

Permalink
Updates rtfd documentation steps
Browse files Browse the repository at this point in the history
  • Loading branch information
kushaldas committed Feb 12, 2025
1 parent 7935ec4 commit 25536ca
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 9 deletions.
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# File: .readthedocs.yaml

version: 2

# Set the OS, Python version and other tools you might need

build:
os: ubuntu-22.04
tools:
python: "3.12"
# Build from the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py

# Explicitly set the version of Python and its requirements
python:
install:
- requirements: docs/requirements.txt
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
author = 'Kushal Das'

# The short X.Y version
version = '0.14.1'
version = '0.16.0'
# The full version, including alpha/beta/rc tags
release = '0.14.1'
release = '0.16.0'


# -- General configuration ---------------------------------------------------
Expand Down Expand Up @@ -58,7 +58,7 @@
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = None
language = "en"

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sphinx
41 changes: 35 additions & 6 deletions docs/rustimplementation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,38 @@ For type annotation we have a Type Alias called `KeyData` as following:

KeyData = Tuple[List[Dict[Any, Any]], str, bool, datetime, datetime, Dict[Any, Any]]

Which has the following structure.

The first item of the tuple is about `certifications`, where each item is a dictionary, the following details:

::

{'certifications': [{'certification_list': [('fingerprint',
'93DA7006C2E7043E8C33ED1BA6C152738D03C7D1'),
('keyid', 'A6C152738D03C7D1')],
'certification_type': 'generic',
'creationtime': datetime.datetime(2021, 11, 3, 10, 54, 6)},
{'certification_list': [('fingerprint',
'749596FAA93B58C88423141F198C1AFD505152DD'),
('keyid', '198C1AFD505152DD')],
'certification_type': 'generic',
'creationtime': datetime.datetime(2021, 11, 3, 10, 52, 50)}],
'email': 'kushal@sunet.se',
'name': 'Kushal Das',
'revoked': False,
'value': 'Kushal Das <kushal@sunet.se>'}

A list of certifications for the given UID, shows *email* and *name* and if
*revoked* or not, and the full *value* of the UID. Then fingerprint of the
primary key, and a *boolean* value to say if it secret key (`True`) or public
key (`False`). Next twovalues are *expirarion* and *creation* of the primary
key. *expiration* can be `None`.
The last time of the tuple is another dictionary, with keys explaining *can_primary_sign*, then *keyid* of the
primary key, and *subkeys* contains a list of tuples for each usable subkey. Each tuple in turn contains the following
`(subkey_id, fingerprint, creation, Optional[expriation])`




.. function:: parse_cert_bytes(certdata: bytes,nullpolicy: Optional[bool])) -> KeyData:

Expand All @@ -27,7 +59,6 @@ For type annotation we have a Type Alias called `KeyData` as following:
`nullpolicy` argument was added.



.. function:: parse_cert_file(certfile: str,nullpolicy: Optional[bool]) -> KeyData:

This function parses the given `certfile` path (as string) and returns the parsed output as a Tuple. If you parse the `nullpolicy` argument, then we can parse old
Expand All @@ -44,19 +75,20 @@ For type annotation we have a Type Alias called `KeyData` as following:

.. versionadded:: 0.16.0


.. function:: update_subkeys_expiry_in_cert(certdata: bytes, fingerprints: List[str], expirytime: int, password: str ) -> bytes:

Updates the expiry date of the given subkeys.


.. function:: update_primary_expiry_on_card(certdata: bytes, expirytime: int, pin: bytes ) -> bytes:

Updates primary key expiry time in the certificate and returns the udpated certificate as bytes.


.. function:: update_subkeys_expiry_on_card(certdata: bytes, fingerprints: List[str], expirytime: int, pin: bytes) -> bytes:

Updates the expiry date of the given subkeys.

This function updates the expiry date of the given subkeys and returns the new certificate.

.. function:: parse_keyring_file(certfile: str) -> List[Tuple[KeyData, bytes]]:

Expand Down Expand Up @@ -108,9 +140,6 @@ For type annotation we have a Type Alias called `KeyData` as following:
>>> rjce.get_key_cipher_details(key.keyvalue)
[('F4F388BBB194925AE301F844C52B42177857DD79', 'EdDSA', 256), ('102EBD23BD5D2D340FBBDE0ADFD1C55926648D2F', 'EdDSA', 256), ('85B67F139D835FA56BA703DB5A7A1560D46ED4F6', 'ECDH', 256)]

.. function:: update_subkeys_expiry_in_cert(certdata: bytes, fingerprints: List[str], expirytime: int, password: string) -> bytes:

This function updates the expiry date of the given subkeys and returns the new certificate.

.. function:: revoke_uid_in_cert(certdata: bytes, uid: bytes, password: string) -> bytes:

Expand Down

0 comments on commit 25536ca

Please sign in to comment.