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

signer: move spx keygen, sign and verify API #568

Merged
merged 2 commits into from
May 24, 2023

Commits on Apr 14, 2023

  1. signer: move spx keygen, sign and verify API

    This was previously part of the `securesystemslib.keys` interface.
    To prepare for deprecation of this interface, and use of the new
    signer API as replacement, spx-related functionality and test are
    moved.
    
    This is a backwards incompatible change and a slight feature
    degradation:
    
    - spx is now no longer available via the keys module, and
    thus no longer available SSlibSigner/SSlibKey (i.e. the legacy
    API bridge). Given that spx was added recently, support via the legacy
    API does not seem necessary. The advantage is more modular code and
    less case-handling, also wrt different optional dependencies.
    
    - Currently, SpxSigner does not implement from_priv_key_uri, which
    was previously available via SSlibSigner, and supported loading
    signers from file or envvar. Support may be added back later.
    
    - The default keyid is computed differently than before (see
    6c29cae)
    
    See usage example in docstring.
    
    Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu>
    lukpueh committed Apr 14, 2023
    Configuration menu
    Copy the full SHA
    af99755 View commit details
    Browse the repository at this point in the history

Commits on May 23, 2023

  1. signer: replace SpxSigner.new_ with raw keygen func

    * Removes previously added SpxSigner.new_ key pair generation method.
      This method may be convenient to quickly test spx signing, but does
      not fit well into the signer API usage pattern, where key generation;
      public key and signer URI loading; and signer loading (from URI) plus
      signing are separate workflows.
    
    * Adds function to generate and return raw key pair bytes.
      * This function is "syntactic sugar" (quote @jku) over the PySPX library.
      * It is added here to provide consistent error handling, if the
        optional library is not available.
      * Otherwise, it needs additional tooling to fit well into the signer
        API, e.g. an interface that stores the created private bytes to a
        place from where they can be loaded using Signer.from_priv_key_uri.
    
    * Adds helper factory method to create an SpxKey instance from raw bytes.
    
    * Adopts changes in usage example and tests.
    lukpueh committed May 23, 2023
    Configuration menu
    Copy the full SHA
    c0671c4 View commit details
    Browse the repository at this point in the history