Skip to content
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

Feature/2024/12/05 add cose header typ #215

Merged
merged 2 commits into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
* Changes primary constructor visibility to `internal` to check for `ByteStringWrapper` as payload type, which shall be rejected
* Do not use DID key identifiers as keyId for `CoseKey`
* Fix BitSet iterator
* Add cose header `typ`

### 3.10.0 (Supreme 0.5.0) More ~~cowbell~~ targets!
A new artifact, minor breaking changes and a lot more targets ahead!
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,20 @@ data class CoseHeader(
@ByteString
// TODO Might also be an array, if there is a real chain, not only one cert
val certificateChain: ByteArray? = null,

/**
* https://www.rfc-editor.org/rfc/rfc9596
* The "typ" (type) header parameter is used by COSE applications to declare the type of
* this complete COSE object, as compared to the content type header parameter, which declares
* the type of the COSE object payload. This is intended for use by the application when more
* than one kind of COSE object could be present in an application data structure that can
* contain a COSE object; the application can use this value to disambiguate among the different
* kinds of COSE objects that might be present. It will typically not be used by applications
* when the kind of COSE object is already known. Use of this header parameter is OPTIONAL.
*/
@CborLabel(16)
@SerialName("typ")
val type: String? = null,
) {

fun serialize() = coseCompliantSerializer.encodeToByteArray(this)
Expand Down
Loading