Class COSEObject
java.lang.Object
com.authlete.cbor.CBORItem
com.authlete.cbor.CBORItemList
com.authlete.cose.COSEObject
- Direct Known Subclasses:
COSEMessage
,COSERecipient
,COSESignature
COSE Object
This class represents the basic COSE structure described in 2. Basic COSE Structure of RFC 9052.
- Since:
- 1.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCOSEObject
(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem content, CBORItem... additionalItems) A constructor with a protected header, an unprotected header, a content, and additional items. -
Method Summary
Modifier and TypeMethodDescriptionGet the protected header of this COSE object.Get the unprotected header of this COSE object.Methods inherited from class com.authlete.cbor.CBORItemList
encode, getItems, parse, prettify, toString
Methods inherited from class com.authlete.cbor.CBORItem
encode, encodeMajorWithNumber, encodeToBase64, encodeToBase64Url, encodeToHex, getComment, prettify, setComment, toString
-
Constructor Details
-
COSEObject
public COSEObject(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem content, CBORItem... additionalItems) throws IllegalArgumentException A constructor with a protected header, an unprotected header, a content, and additional items.- Parameters:
protectedHeader
- The protected header. Must not be null.unprotectedHeader
- The unprotected header. Must not be null.content
- The content. Must be eitherCBORByteArray
orCBORNull
.additionalItems
- Additional items.- Throws:
IllegalArgumentException
-protectedHeader
is null,unprotectedHeader
is null, orcontent
is neither aCBORByteArray
instance nor aCBORNull
instance.
-
-
Method Details
-
getProtectedHeader
Get the protected header of this COSE object.- Returns:
- The protected header.
-
getUnprotectedHeader
Get the unprotected header of this COSE object.- Returns:
- The unprotected header.
-