Util
Utility functions.
Functions
Returns #6.0(tstr) where tstr is the ISO 8601 encoding of the given point in time. Only supports UTC times.
Returns #6.24(bstr) of the given already encoded CBOR
Extracts the first CBOR data item from a stream of bytes.
For a #6.24(bstr), extracts the bytes and decodes it and returns the decoded CBOR as a DataItem.
For a #6.24(bstr), extracts the bytes.
Helper to determine the length of a single encoded CBOR data item.
Accepts a DataItem
, attempts to cast it to a Number
, then returns the value Throws IllegalArgumentException
if the DataItem
is not a Number
. This method also checks bounds, and if the given data item is too large to fit in a long, it throws ArithmeticException
.
Accepts a DataItem
, attempts to cast it to a UnicodeString
, then returns the value. Throws IllegalArgumentException
if the DataItem
is not a UnicodeString
.
Currently only ECDSA signatures are supported.
Returns the empty byte-array if no data is included in the structure.
Returns the empty collection if no x5chain is included in the structure.
Note: this uses the default JCA provider which may not support a lot of curves, for example it doesn't support Brainpool curves. If you need to use such curves, use .coseSign1Sign instead with a Signature created using a provider that does have support.
Helper function to create a CBOR data for requesting data items. The IntentToRetain value will be set to false for all elements.
Brute-force but good enough since users will only pass relatively small amounts of data.
Clears elementValue in IssuerSignedItemBytes CBOR.
Sets elementValue in IssuerSignedItem CBOR.
Version comparison method for mdoc versions.
Helper function to check if a given certificate chain is valid.