Class COSEMac
java.lang.Object
com.authlete.cbor.CBORItem
com.authlete.cbor.CBORItemList
com.authlete.cose.COSEObject
com.authlete.cose.COSEMessage
com.authlete.cose.COSEMac
COSE_Mac
COSE_Mac is defined in 6.1. MACed
Message with Recipients of RFC 9052 as follows.
COSE_Mac = [
Headers,
payload : bstr / nil,
tag : bstr,
recipients : [+COSE_recipient]
]
- Since:
- 1.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCOSEMac(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem payload, CBORByteArray tag, CBORItemList recipients) A constructor with a protected header, an unprotected header, a payload, a tag and recipients. -
Method Summary
Methods inherited from class com.authlete.cose.COSEMessage
getTagged, getTagNumber, getTypeMethods 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
-
COSEMac
public COSEMac(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem payload, CBORByteArray tag, CBORItemList recipients) A constructor with a protected header, an unprotected header, a payload, a tag and recipients.- Parameters:
protectedHeader- A protected header. Must not be null.unprotectedHeader- An unprotected header. Must not be null.payload- A payload. Must be eitherCBORByteArrayorCBORNull.tag- A tag. Must not be null.recipients- Recipients. Must not be null. Items in the list must be instances ofCOSERecipient. At least one element must be contained.
-
-
Method Details
-
getPayload
Get the payload.The type of the value is
CBORByteArrayorCBORNull.- Returns:
- The payload.
-
getTag
-
getRecipients
Get the list of recipients. Items in the list areCOSERecipientinstances.- Returns:
- The list of recipients.
-
build
Build aCOSEMacinstance from the given CBOR data item. The data item must be a CBOR array.- Parameters:
item- A CBOR data item that representsCOSE_Mac.- Returns:
- A
COSEMacinstance built from the given CBOR data item. - Throws:
COSEException
-
build
Build aCOSEMacinstance from the given object list.- Parameters:
list- A object list that representsCOSE_Mac.- Returns:
- A
COSEMacinstance built from the given object list. - Throws:
COSEException
-