-
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
Java implementation issue with Keys abstract class. #327
Comments
Hi @saujam as you see in the picture, I could reproduce the issue. Due to the "inline" Result class the suffix is produced, which can not be inherited from Java. To solve this issue, I could think of two options: I will discuss these options with the team an come back to you. |
Hi @saujam, if you want to implement a Key in Java instead of Kotlin, you will have to extend from This is a stub you can utilize: import id.walt.crypto.keys.JavaKey;
import id.walt.crypto.keys.Key;
import id.walt.crypto.keys.KeyMeta;
import id.walt.crypto.keys.KeyType;
import java.util.Map;
import kotlinx.serialization.json.JsonElement;
import kotlinx.serialization.json.JsonObject;
import org.jetbrains.annotations.NotNull;
public class MyKey extends JavaKey {
private String _xyz;
public MyKey(String xyz) {
this._xyz = xyz;
}
@NotNull
@Override
public KeyMeta javaGetMeta() {
return null;
}
@NotNull
@Override
public byte[] javaGetPublicKeyRepresentation() {
return new byte[0];
}
@NotNull
@Override
public Key javaGetPublicKey() {
return null;
}
@NotNull
@Override
public JsonElement javaVerifyJws() {
return null;
}
@NotNull
@Override
public byte[] javaVerifyRaw() {
return new byte[0];
}
@NotNull
@Override
public String javaSignJws(@NotNull byte[] plaintext, @NotNull Map<String, String> headers) {
return "";
}
@NotNull
@Override
public Object javaSignRaw(@NotNull byte[] plaintext) {
return null;
}
@NotNull
@Override
public String javaExportPEM() {
return "";
}
@NotNull
@Override
public JsonObject javaExportJWKObject() {
return null;
}
@NotNull
@Override
public String javaExportJWK() {
return "";
}
@NotNull
@Override
public String javaGetThumbprint() {
return "";
}
@NotNull
@Override
public String javaGetKeyId() {
return "";
}
@Override
public boolean javaHasPrivateKey() {
return false;
}
@NotNull
@Override
public KeyType javaGetKeyType() {
return null;
}
} |
What is the release version for java key implementation. |
Hi Team,
I am experiencing this issue when extending the Keys class (id.walt.crypto.keys) from waltid-crypto-jvm-0.2.0.jar. The issue occurs only with the following methods since the java de-compiler adds a postfix (verifyRaw-0E7RQCE) with a dash character that Java does not support.
I would appreciate it if you could check and let me know.
The text was updated successfully, but these errors were encountered: