-
Notifications
You must be signed in to change notification settings - Fork 6
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
COSE Signed API #194
base: development
Are you sure you want to change the base?
COSE Signed API #194
Conversation
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.
Why does this behave differently from JwsSigned, that has the typed payload as property? should not the seriializer handle conversion from/to bytestringwrapper?
fun serialize() = coseCompliantSerializer.encodeToByteArray(this) | ||
fun serialize(): ByteArray = coseCompliantSerializer.encodeToByteArray(CoseSignedSerializer(), this) | ||
|
||
fun getTypedPayload(deserializationStrategy: DeserializationStrategy<P>): KmmResult<P?> = catching { |
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.
This should be lazy and a test that is not already based on a bytearray would be nice
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.
Can't be lazy property since it needs a parameter.
In VCK, there's bytestringwrapper all over the place, i think we can do away with it and add this wrapping logic into the serializer, while we're at it |
@n0900 can this be made more convenient: as in: directly pass the typed payload to the constructor and have the serializer handle the byte string wrapping? I know it's different from your serialization foo, because it can by any type, but still… |
Best I can do with my knowledge of kotlinx serialization ... |
Adds a type parameter to
CoseSigned
. While not as thorough as forJwsSigned
, it's still worth it to provide some form of guidance to clients as which payload to expect.See also a-sit-plus/vck#165