-
Notifications
You must be signed in to change notification settings - Fork 35
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
Added P-384 Utils #21
Conversation
@SailReal Can you verify if these changes work on Android 7? Path somePath = ...
P384KeyPair orig = P384KeyPair.generate();
orig.store(somePath, "somePassword".toCharArray());
P384KeyPair loaded = P384KeyPair.load(somePath, "somePassword".toCharArray());
assert orig.equals(loaded); |
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 very promising but all of java.nio.file was added in API level 26 (Android 8.0) that means it is not possible to get e.g. a Path
instance in pre Android 8.0 and pass it to P384KeyPair
. Maybe we can provide further methods where we can pass in the input/output-stream of the key material like in MasterkeyFileAccess
?
But it is still possible to load a class that has a So overloading the method such as here works? cryptolib/src/main/java/org/cryptomator/cryptolib/common/MasterkeyFileAccess.java Lines 117 to 134 in 3347bc0
|
Yes to both questions :) |
Kudos, SonarCloud Quality Gate passed! |
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.
LGTM, tested on Android 7 and 11:
val out = applicationContext.openFileOutput("foo", Context.MODE_PRIVATE)
val orig = P384KeyPair.generate();
orig.store(out, "somePassword".toCharArray())
val in = applicationContext.openFileInput("foo")
val loaded = P384KeyPair.load(in, "somePassword".toCharArray())
=> orig.equals(loaded) == true
Added some utility classes to generate P-384 key pairs, store them to PKCS12 files and load them again.