Class COSEMessage
java.lang.Object
com.authlete.cbor.CBORItem
com.authlete.cbor.CBORItemList
com.authlete.cose.COSEObject
com.authlete.cose.COSEMessage
- Direct Known Subclasses:
COSEEncrypt,COSEEncrypt0,COSEMac,COSEMac0,COSESign,COSESign1
COSE Message
This class represents COSE_Untagged_Message which is defined in
2. Basic
COSE Structure of RFC 9052.
- Since:
- 1.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCOSEMessage(COSEMessageType type, COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem content, CBORItem... additionalItems) A constructor. -
Method Summary
Modifier and TypeMethodDescriptionWrap this COSE message with a CBOR tag.intGet the tag number of this COSE message.getType()Get the type of this COSE message.Methods inherited from class com.authlete.cose.COSEObject
getProtectedHeader, getUnprotectedHeaderMethods inherited from class com.authlete.cbor.CBORItemList
encode, getItems, parse, prettify, toStringMethods inherited from class com.authlete.cbor.CBORItem
encode, encodeMajorWithNumber, encodeToBase64, encodeToBase64Url, encodeToHex, getComment, prettify, setComment, toString
-
Constructor Details
-
COSEMessage
public COSEMessage(COSEMessageType type, COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem content, CBORItem... additionalItems) throws IllegalArgumentException A constructor.- Parameters:
type- The type of this COSE message.protectedHeader- The protected header. Must not be null.unprotectedHeader- The unprotected header. Must not be null.content- The content. Must be eitherCBORByteArrayorCBORNull.additionalItems- Additional items.- Throws:
IllegalArgumentException-typeis null,protectedHeaderis null,unprotectedHeaderis null, orcontentis neither aCBORByteArrayinstance nor aCBORNullinstance.
-
-
Method Details
-
getType
Get the type of this COSE message.- Returns:
- The type of this COSE message.
- Since:
- 1.4
-
getTagNumber
public int getTagNumber()Get the tag number of this COSE message.CBOR Tag Data Item Java Class 16 COSE_Encrypt0COSEEncrypt017 COSE_Mac0COSEMac018 COSE_Sign1COSESign196 COSE_EncryptCOSEEncrypt97 COSE_MacCOSEMac98 COSE_SignCOSESign- Returns:
- The tag number.
- See Also:
-
getTagged
Wrap this COSE message with a CBOR tag.This method is equivalent to "
new".CBORTaggedItem(getTagNumber(), this)- Returns:
- A tagged COSE message.
-