-
Notifications
You must be signed in to change notification settings - Fork 92
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
Convert identity library to Kotlin. #467
Conversation
f32a0fb
to
b7957b9
Compare
...c/main/java/com/android/identity/wallet/support/androidkeystore/AndroidAuthKeyCurveOption.kt
Show resolved
Hide resolved
...main/java/com/android/identity/wallet/support/softwarekeystore/SoftwareAuthKeyCurveOption.kt
Outdated
Show resolved
Hide resolved
...roid/src/main/java/com/android/identity/android/mdoc/deviceretrieval/VerificationHelper.java
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/AuthenticationKey.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/AuthenticationKey.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/CredentialRequest.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/CredentialStore.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/CredentialStore.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/CredentialStore.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/CredentialUtil.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/CredentialUtil.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
identity/src/main/java/com/android/identity/credential/NameSpacedData.kt
Outdated
Show resolved
Hide resolved
} catch (e: NoSuchAlgorithmException) { | ||
throw IllegalStateException("Unexpected error", e) | ||
} catch (e: InvalidKeySpecException) { | ||
throw IllegalStateException("Unexpected error", e) | ||
} catch (e: IOException) { | ||
throw IllegalStateException("Unexpected error", e) | ||
} catch (e: NoSuchProviderException) { | ||
throw IllegalStateException("Unexpected error", e) | ||
} |
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.
"Catches can be joined"
} catch (e: NoSuchAlgorithmException) { | ||
throw IllegalStateException("Unexpected error", e) | ||
} catch (e: InvalidParameterSpecException) { | ||
throw IllegalStateException("Unexpected error", e) | ||
} catch (e: InvalidKeySpecException) { | ||
throw IllegalStateException("Unexpected error", e) | ||
} |
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.
"join catches" like above
} catch (e: NoSuchAlgorithmException) { | ||
throw IllegalStateException(e) | ||
} catch (e: InvalidParameterSpecException) { | ||
throw IllegalStateException(e) | ||
} catch (e: InvalidKeySpecException) { | ||
throw IllegalStateException(e) |
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.
"catches can be joined"
} catch (e: IOException) { | ||
throw IllegalStateException("Error signing key with private key", e) | ||
} catch (e: InvalidKeyException) { | ||
throw IllegalStateException("Error signing key with private key", e) | ||
} catch (e: KeyStoreException) { | ||
throw IllegalStateException("Error signing key with private key", e) | ||
} catch (e: NoSuchAlgorithmException) { | ||
throw IllegalStateException("Error signing key with private key", e) | ||
} catch (e: SignatureException) { | ||
throw IllegalStateException("Error signing key with private key", e) | ||
} catch (e: UnrecoverableEntryException) { | ||
throw IllegalStateException("Error signing key with private key", e) | ||
} catch (e: CertificateException) { | ||
throw IllegalStateException("Error signing key with private key", e) | ||
} |
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.
join catches
b7957b9
to
3347610
Compare
Took all the good suggestions up-until |
3e99b05
to
b491da7
Compare
Looks great! Couple of comment for the future
I've force-pushed with that change. |
Also move all mdoc specific code to a new identity-mdoc library. Test: Manually tested (appholder, appverifier, samples/preconsent-mdl, samples/age-verifier-mdl, wallet, secure-area-test-app) Test: New unit tests and all unit tests pass (wallet, identity, identity-mdoc, identity-android). Signed-off-by: David Zeuthen <[email protected]>
Signed-off-by: dritan-x <[email protected]>
b491da7
to
8c85092
Compare
Also, some unit tests didn't compile and when they did, they failed (there was a one-off in one of the kotlinized low-level utils, fixed that). Added a commit with fixes for this and also manually tested all apps and samples. Works fine. |
c73aec1
to
c80021c
Compare
Test: All unit tests pass Test: Manually tested (appholder, appverifier, samples/preconsent-mdl, samples/age-verifier-mdl, samples/simple-verifier, wallet, secure-area-test-app) Signed-off-by: David Zeuthen <[email protected]>
c80021c
to
6f6103c
Compare
* Convert identity library to Kotlin. Also move all mdoc specific code to a new identity-mdoc library. Test: Manually tested (appholder, appverifier, samples/preconsent-mdl, samples/age-verifier-mdl, wallet, secure-area-test-app) Test: New unit tests and all unit tests pass (wallet, identity, identity-mdoc, identity-android). Signed-off-by: David Zeuthen <[email protected]> * kotlinizing branch convert-identity-to-kotlin Signed-off-by: dritan-x <[email protected]> * Minor fixes for build and tests. Test: All unit tests pass Test: Manually tested (appholder, appverifier, samples/preconsent-mdl, samples/age-verifier-mdl, samples/simple-verifier, wallet, secure-area-test-app) Signed-off-by: David Zeuthen <[email protected]> --------- Signed-off-by: David Zeuthen <[email protected]> Signed-off-by: dritan-x <[email protected]> Co-authored-by: dritan-x <[email protected]>
* Convert identity library to Kotlin. Also move all mdoc specific code to a new identity-mdoc library. Test: Manually tested (appholder, appverifier, samples/preconsent-mdl, samples/age-verifier-mdl, wallet, secure-area-test-app) Test: New unit tests and all unit tests pass (wallet, identity, identity-mdoc, identity-android). Signed-off-by: David Zeuthen <[email protected]> * kotlinizing branch convert-identity-to-kotlin Signed-off-by: dritan-x <[email protected]> * Minor fixes for build and tests. Test: All unit tests pass Test: Manually tested (appholder, appverifier, samples/preconsent-mdl, samples/age-verifier-mdl, samples/simple-verifier, wallet, secure-area-test-app) Signed-off-by: David Zeuthen <[email protected]> --------- Signed-off-by: David Zeuthen <[email protected]> Signed-off-by: dritan-x <[email protected]> Co-authored-by: dritan-x <[email protected]>
Also move all mdoc specific code to a new identity-mdoc library.
Test: Manually tested (appholder, appverifier, samples/preconsent-mdl, samples/age-verifier-mdl, wallet, secure-area-test-app)
Test: New unit tests and all unit tests pass (wallet, identity, identity-mdoc, identity-android).