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

Convert identity library to Kotlin. #467

Merged
merged 3 commits into from
Feb 13, 2024
Merged

Conversation

davidz25
Copy link
Contributor

@davidz25 davidz25 commented Feb 1, 2024

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).

@davidz25 davidz25 force-pushed the convert-identity-to-kotlin branch 3 times, most recently from f32a0fb to b7957b9 Compare February 1, 2024 15:49
@davidz25 davidz25 requested a review from dritan-x February 1, 2024 23:31
Comment on lines 1349 to 1200
} 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)
}
Copy link
Contributor

@dritan-x dritan-x Feb 6, 2024

Choose a reason for hiding this comment

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

"Catches can be joined"

Comment on lines 1804 to 1645
} catch (e: NoSuchAlgorithmException) {
throw IllegalStateException("Unexpected error", e)
} catch (e: InvalidParameterSpecException) {
throw IllegalStateException("Unexpected error", e)
} catch (e: InvalidKeySpecException) {
throw IllegalStateException("Unexpected error", e)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

"join catches" like above

Comment on lines 1777 to 1620
} catch (e: NoSuchAlgorithmException) {
throw IllegalStateException(e)
} catch (e: InvalidParameterSpecException) {
throw IllegalStateException(e)
} catch (e: InvalidKeySpecException) {
throw IllegalStateException(e)
Copy link
Contributor

Choose a reason for hiding this comment

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

"catches can be joined"

Comment on lines 1956 to 1794
} 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)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

join catches

@davidz25 davidz25 force-pushed the convert-identity-to-kotlin branch from b7957b9 to 3347610 Compare February 6, 2024 17:26
@davidz25
Copy link
Contributor Author

davidz25 commented Feb 6, 2024

Took all the good suggestions up-until Util.kt and force-pushed the branch with those.

@davidz25 davidz25 force-pushed the convert-identity-to-kotlin branch from 3e99b05 to b491da7 Compare February 13, 2024 15:02
@davidz25
Copy link
Contributor Author

davidz25 commented Feb 13, 2024

Looks great! Couple of comment for the future

  • avoid merge commits (rebase instead)
  • remember Signed-off-by to keep the DCO check happy

I've force-pushed with that change.

davidz25 and others added 2 commits February 13, 2024 10:07
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]>
@davidz25 davidz25 force-pushed the convert-identity-to-kotlin branch from b491da7 to 8c85092 Compare February 13, 2024 15:08
@davidz25
Copy link
Contributor Author

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.

@davidz25 davidz25 force-pushed the convert-identity-to-kotlin branch 8 times, most recently from c73aec1 to c80021c Compare February 13, 2024 20:52
@dritan-x dritan-x self-assigned this Feb 13, 2024
@dritan-x dritan-x self-requested a review February 13, 2024 21:04
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]>
@davidz25 davidz25 force-pushed the convert-identity-to-kotlin branch from c80021c to 6f6103c Compare February 13, 2024 21:49
@davidz25 davidz25 merged commit a8311ba into main Feb 13, 2024
5 checks passed
@davidz25 davidz25 deleted the convert-identity-to-kotlin branch February 13, 2024 22:10
sorotokin pushed a commit that referenced this pull request Feb 14, 2024
* 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]>
sorotokin pushed a commit that referenced this pull request Feb 16, 2024
* 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]>
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.

2 participants