-
Notifications
You must be signed in to change notification settings - Fork 88
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
Conversion of package appverifier > readercertgen to Kotlin #397
Conversion of package appverifier > readercertgen to Kotlin #397
Conversation
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.
Looks good! I only added some styling/formatting remarks, but nothing serious
|
||
// Extensions -------------------------- | ||
val jcaX509ExtensionUtils: JcaX509ExtensionUtils | ||
jcaX509ExtensionUtils = try { |
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.
This can be defined into a single expression, like so:
val jcaX509ExtensionUtils = try {
...
} catch {
...
}
or even
the type will be inferred automatically
return try { | ||
// NOTE older devices may not have the right BC installed for this to work | ||
val kpg: KeyPairGenerator | ||
if (curve.equals("Ed25519", ignoreCase = true) || curve.equals( |
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.
maybe the formatting of this if can be improved, as it is a bit tricky to read it this way 🤔
I'd move the expression from || onwards in the line below, something like
if (curve.equals("Ed25519", ignoreCase = true)
|| curve.equals("Ed448", ignoreCase = true)
) {
....
}
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.
Looks good
Fixes #TBD (conversion to Kotlin, second intent to create this pull request...)
Conversion of package appverifier > readercertgen to Kotlin