-
Notifications
You must be signed in to change notification settings - Fork 213
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
js: Add ccf.crypto.verifySignature
#2661
Conversation
letmaik/js-verify-signature@27736 aka 20210623.8 vs main ewma over 20 builds from 27398 to 27730 Click to see table
|
@@ -251,6 +263,25 @@ export interface CCF { | |||
*/ | |||
isValidX509CertChain(chain: string, trusted: string): boolean; | |||
|
|||
crypto: { | |||
/** | |||
* Returns whether digital signature is valid. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to list the RSA key sizes and EC curve names this supports for clarity, either here or in the definitions of the SigningAlgorithm interfaces.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no restriction on the RSA key sizes or EC curves. Anything that OE-OpenSSL supports will work. The only limitation is in the supported digest algorithms which is already a TypeScript type and self-documented. I'd like to extend that from SHA-256 eventually to SHA-384 but want to do it across the board, so including ccf.digest(), and currently CCF doesn't have native SHA-384 digest support.
I found https://github.com/openenclave/openenclave/blob/master/docs/OpenSSLSupport.md but it's not that useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, thank you.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@letmaik thank you for this useful API addition. Since this is making new functionality available to users, could you please document it in the Changelog?
If this PR is ok I'd like to get it merged and if possible kick off a dev release to consume it together with the new bytecode cache feature. |
ccf.verifySignature
ccf.crypto.verifySignature
Loosely modeled after https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/verify.