-
-
Notifications
You must be signed in to change notification settings - Fork 316
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
bug: KeyStore.toJWKS(true) crashed if keystore includes some public keys #42
Comments
That’s expected behaviour and not a bug. Only private keys can be exported this way. Encountering a public one is indicative of a mixed keystore and its safer not to export anything. |
If mixed keystores are ok then - there should be no problem with exposing them. If mixed keystores are not ok - the error should be raised as early as possible - at the moment when the keystore is becoming mixed The current behavior is problematic because it means that if I'm trying to do On the other hand, how exposing a public key can be unsafe? EDIT: Adding of a public key to a keystore is preventing from obtaining its private keys. So the element of a collection affects the whole collection. This is not a behavior that you would expect from any kind of collection |
@Alexsey I hear you, v1.9.2 addresses this. |
Cool, thank you! |
Describe the bug
If the KeyStore instance includes at least one public key then
.toJWKS(true)
would throw an errorpublic key cannot be exported as private
To Reproduce
Expected behaviour
It should be stringified with one private and one public key (preferable)
OR
Key Store should not allow adding both private and public key at the same time
Environment:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: