Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CryptoSigner: support init from PrivateKeyTypes #675

Merged
merged 2 commits into from
Nov 22, 2023

Commits on Nov 15, 2023

  1. CryptoSigner: support init from PrivateKeyTypes

    Previously CryptoSigner instances could only be created via
    `from_priv_key_uri` factory method, because:
    - CryptoSigner was abstract
    - Subclass implmentations were protected
    
    This change makes the CryptoSigner constructor usable directly, so that
    signers can be created directly from pyca/cryptography private key
    objects.
    
    If a public key is not passed along, it is created from the private key,
    with default keyid and signing scheme for key type.
    
    *Details*
    
    Internally, this now (1) uses composition instead of inheritance, and (2)
    eliminates one level of abstraction:
    
    (1) CryptoSigner is no longer an abstract base class for protected
    rsa, ecdsa and ed25519 "signer" subclasses. It only made creation more
    difficult, without advantage. Instead CryptoSigner holds references to
    the "signers"
    
    (2) There is no more abstraction over individual pyca/cryptography rsa,
    ecdsa and ed25519 private key types. cryptography provides a common
    "PrivateKeyTypes" interface with sign method, which we can use directly.
    The different additional sign args for the different key types are
    managed in new internal data classes.
    
    Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
    lukpueh committed Nov 15, 2023
    Configuration menu
    Copy the full SHA
    28b6457 View commit details
    Browse the repository at this point in the history

Commits on Nov 22, 2023

  1. CryptoSigner: add docstring with usage options

    Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
    lukpueh committed Nov 22, 2023
    Configuration menu
    Copy the full SHA
    0f8d337 View commit details
    Browse the repository at this point in the history