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

Support for creation of key-pairs #462

Closed
dany74q opened this issue Aug 29, 2020 · 2 comments
Closed

Support for creation of key-pairs #462

dany74q opened this issue Aug 29, 2020 · 2 comments

Comments

@dany74q
Copy link
Contributor

dany74q commented Aug 29, 2020

Heya !

For the past few days, I've been working on making webuathn flows to work with OSX's keychain;
During this process, I had to write various wrappers, helpers, and logic that I think would be best served if it were split and contributing to several OSS libraries.

Keyring is the de-facto python standard for accessing OSX keychain - I wonder if you'd be open to the idea of extending the password-oriented interface to storing, retrieving (and potentially signing with) private & public keys;
or alternatively, offering implementations that implement a password interface, and an additional keypair interface.

I have the keychain related logic for it - and not sure this expansion would make sense for every backend.

Let me know if you think this is directionally interesting for the future of keyring, or if it's too far-off the main goal of the library.

Thanks, appreciate your time !

@jaraco
Copy link
Owner

jaraco commented Aug 30, 2020

Hey Dany. Definitely open to improvements, and as we've seen with the introduction of get_credential, it's possible to introduce a feature incrementally across backends. If we can envision a design in which each backend could potentially implement an interface for key pairs, I'd be okay with the macOS backend being the only backend that implements it (initially).

To start, what is it that's special about public/private keypairs? What features would you expect from an interface supporting keypairs? What would prevent a library from building on top of keyring to store/retrieve a key pair using the get_password and set_password primitives?

@dany74q
Copy link
Contributor Author

dany74q commented Aug 30, 2020

@jaraco - great questions, I think that the last one stresses an important point,
and that is - one can probably b64 encode the keypair and store it as a password,
with no real loss of functionality.

I've looked at other supported backends (namely, SecretService, KWallet, Win CredLocker), to get a better feel as to if any of them have a dedicated key pair primitive;
none of them seem to offer such granularity between secret types.

To that end, I think you led me to a better option - I can either create an external backend that uses
keychain's key pair primitives - if on a second glance it would seem that there's any benefit to categorize the secret
as a keypair;
or simply encode & store it as a generic password.

One of the above will fit well with my end goal - so I don't think there's a clear advantage to have such support baked in to the library itself.

Appreciate your input !

@dany74q dany74q closed this as completed Aug 30, 2020
dany74q added a commit to dany74q/keyring that referenced this issue Sep 20, 2020
clrpackages pushed a commit to clearlinux-pkgs/keyring that referenced this issue Nov 17, 2020
…21.5.0

Danny Shemesh (1):
      Added the keyrings.osx-keychain-keys backend, as discussed in jaraco/keyring#462

Dmitry Shachnev (2):
      Disable SecretService backend if org.freedesktop.secrets name is not available
      Disable KWallet backend if org.kde.kwalletd5 name is not available

Jason R. Coombs (22):
      Create Github releases when releasing the package. Fixes jaraco/skeleton#23.
      Moved refresh.svg to another branch. Reference the animation from the docs. Ref jaraco/skeleton#7.
      Add the env var mapping too.
      Disable pytest-black and pytest-mypy on PyPy. Fixes jaraco/skeleton#22. Ref pytest-dev/pytest#7675.
      Bump black and blacken-docs to latest stable versions.
      Use enabled plugin configuration to enable mypy and black when the plugin is present. Ref jaraco/skeleton#22.
      Omit 'return None' as it's implied.
      Update changelog. Ref #463.
      Add type hints for KeyringBackend.get_password and .get_credential. I was hoping adding these hints would capture the missed expectation in #463, but alas, they do not.
      Wrap lines before 80 col. Reword to use imperative voice and give directions in order of execution. Clarify that only passwords created by an executable of Python are relevant.
      Also enable flake8 and cov when the plugins are present.
      Add workflows for running tests. Ref jaraco/skeleton#24.
      Cut releases from Github Actions instead of Azure Pipelines. Ref jaraco/skeleton#24.
      Refresh docs to prefer Github Actions to Azure Pipelines. Ref jaraco/skeleton#24.
      Use RTD v2 config
      Test on Python 3.9. Skip 3.7 to avoid creating too many builds. Release on 3.9.
      Drop tests on Travis, Appveyor, and Azure Pipelines.
      use add-github-secrets, which infers the secrets needed from the github workflow.
      Use inline flags with local scope.
      Require importlib_metadata 1.0 or later. Fixes #466.
      Update changelog.
      21.4.1 was never released

Josh Faust (1):
      Add a Security Considerations section to the README, with some info about possible issues with the macOS Keychain

László Várady (1):
      Fix return type of KWallet get_credential()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants