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

Handle the presence of attributes or the public key within a private key #75

Open
str4d opened this issue Feb 17, 2019 · 0 comments
Open

Comments

@str4d
Copy link
Owner

str4d commented Feb 17, 2019

RFC 8410 section 7 specifies that a private key may contain attributes, or its corresponding public key. These are marked as OPTIONAL, which per BCP 14 means that we

MUST be prepared to interoperate with another implementation which does include the option, though perhaps with reduced functionality.

I interpret this as meaning we need to handle their potential presence when decoding a key:

  • If attributes are present, we skip over them.
  • If a public key is present, we verify that it matches the private key.

I don't interpret this as meaning we need to support storing them (if provided), or that getEncoded() MUST return the same encoding as was originally passed in (in fact, it explicitly disclaims this in order to migrate keys encoded using the older draft specification back from when this library was first written). In other words, getEncoded() would return the canonical minimal encoding as already-implemented.

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

1 participant