-
Notifications
You must be signed in to change notification settings - Fork 13
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
Support for ECIES with temporary keys #612
Conversation
- Increased protocol version to 3.3
…ptor Docs: Updated documentation
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 OK, I added several smaller comments to naming / constants (it might be easier to change HS256 to HS512 if we have this a bit more abstracted).
final String challenge = Base64.encodeToString(CryptoUtils.randomBytes(18), Base64.NO_WRAP); | ||
final GetTemporaryKeyRequest request = new GetTemporaryKeyRequest(applicationKey, activationId, challenge); | ||
// Prepare JWT string | ||
final String jwtHeader = "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9."; // {"alg":"HS256","typ":"JWT"} with dot separator |
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.
Embedded constant
} | ||
|
||
- (id<PowerAuthOperationTask>) signJwtWithDevicePrivateKey:(PowerAuthAuthentication*)authentication | ||
claims:(NSDictionary<NSString*, NSObject*>*)claims | ||
callback:(void(^)(NSString *jwt, NSError *error))callback | ||
{ | ||
// Prepare JWT Header | ||
NSString * jwtHeader = @"eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9."; // {"alg":"ES256","typ":"JWT"} |
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.
dtto - embedded constant
@@ -2530,22 +2552,16 @@ public void onBiometricDialogFailed(@NonNull PowerAuthErrorException error) { | |||
@Nullable | |||
public ICancelable signJwtWithDevicePrivateKey(@NonNull Context context, @NonNull PowerAuthAuthentication authentication, @NonNull Map<String, Object> claims, @NonNull IJwtSignatureListener listener) { | |||
final JsonSerialization serialization = new JsonSerialization(); | |||
final byte[] serializedClaims = serialization.serializeObject(claims); | |||
return signDataWithDevicePrivateKey(context, authentication, serializedClaims, new IDataSignatureListener() { | |||
final String jwtHeader = "eyJhbGciOiJFUzI1NiIsInR5cCI6IkpXVCJ9"; // {"alg":"ES256","typ":"JWT"} |
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.
dtto - embedded constant
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 OK, just some remarks
...ndroid/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/ecies/EciesMetadata.java
Outdated
Show resolved
Hide resolved
*/ | ||
@Deprecated // 1.9.0 |
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.
Just to consider - maybe we should just remove these methods instead of deprecation? If someone is coming from an older SDK than 1.8, this will lead to an immediate fail anyway (and possible support request). If the client is coming from 1.8 it will work, but I think the majority of our clients are still on 1.7 and older.
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.
We have this policy since the beginning of the SDK development. In my own experience, it's better to have a working build immediately after the upgrade and then I can slowly fix the warnings. This of course expects, that the developers have some common standards applied, such as zero warnings build.
This PR adds support for PowerAuth protocol version 3.3.