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

TypeScript: Added selfCertification property to PrimaryUser interface definition #1594

Merged
merged 2 commits into from Feb 17, 2023

Conversation

rrrooommmaaa
Copy link
Contributor

@rrrooommmaaa rrrooommmaaa commented Feb 9, 2023

It's useful to be able to extract additional data from the signature, e.g. key usage flags

Also changed type definition for Key.verifyAllUsers

@twiss
Copy link
Member

twiss commented Feb 17, 2023

Hey 👋 I'm not entirely opposed to adding this, but just FWIW, in v6 keys, this information will be moved to a direct-key binding signature, and the User ID self-certification won't necessarily be there. So I would advise against looking up information directly in the signature, if you can avoid it. Out of curiosity, what do you need the information for?

Copy link
Member

@twiss twiss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll merge it anyway since we already have User.selfCertifications in the types too. I guess we can make it optional once we merge v6 keys support :)

@twiss twiss merged commit 5b92b80 into openpgpjs:main Feb 17, 2023
@rrrooommmaaa
Copy link
Contributor Author

Out of curiosity, what do you need the information for?

We display primary key usage flags (certifyKeys, signData, encryptCommunication, encryptStorage) on a diagnostics page in our app,
https://github.com/FlowCrypt/flowcrypt-browser/blob/da4363a6eb51121ae585fc36f2273ce209aae04e/extension/js/common/core/crypto/pgp/openpgp-key.ts#L661

It'd be great to be able to extract this info by simpler means (as well as for each of the subkeys).

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

Successfully merging this pull request may close these issues.

None yet

2 participants