-
Notifications
You must be signed in to change notification settings - Fork 52
Description
Bug Report
Describe the Bug
When creating and activating a keypair, some properties of the publicKeyJwk are lost/not stored
Expected Behavior
The publicKeyJwk of the DidDocument is the same as the publicKeyJwk when creating the KeyPair.
Observed Behavior
The KeyPair is stored properly, but the DidDocument is missing some properties.
Example:
A GET to /keypairs gives the correct KeyPair, A GET to /dids does not
Steps to Reproduce
Steps to reproduce the behavior:
- Add KeyPair with properties besides n and e
- Activate the keypair
- get the diddocument of the IH
- publicjwk is missing some properties
Context Information
Add any other context about the problem here.
- Used version EDC 0.12.0
Detailed Description
When creating a KeyPair with the following example body:
{
"active": true,
"keyId": "...",
"privateKeyAlias": "...",
"publicKeyJwk": {
"kty": "RSA",
"n": "...",
"e": "...",
"x5u": "...",
"alg": "..."
}
}
The publicKeyJwk in the verificationMethod of the DidDocument no longer has the properties x5u and alg. The DidDocument has the following publicKeyJwk:
"publicKeyJwk":
{
"kty": "RSA",
"e": "...",
"use": "sig",
"n": "..."
}
Looking at the code and postgres, the KeyPair is properly stored. But it seems like when activating the KeyPair, some properties are lost and not stored in the 'did_resources' relation.
Is this expected, e.g., to remove "unnecessary" or "not wanted" properties from the KeyPair?
Possible Implementation
Looking at the DidDocumentServiceImpl, the serialized jwk is parsed to a parser, the JwkParser, where the toJavaKeys Method is called from the nimbus library. While the serialized jwk still has all properties, the keys in the list are missing some. As far as I understood the nimbus function, all properties except e and n are ignored.