Package COSE
Class MACMessage
- java.lang.Object
-
- COSE.Attribute
-
- COSE.Message
-
- COSE.MacCommon
-
- COSE.MACMessage
-
public class MACMessage extends MacCommon
- Author:
- jimsch
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Recipient>recipientList-
Fields inherited from class COSE.MacCommon
random, rgbTag, strContext
-
Fields inherited from class COSE.Message
emitContent, emitTag, messageTag, rgbContent
-
Fields inherited from class COSE.Attribute
DO_NOT_SEND, DontSendAttributes, externalData, objDontSend, objProtected, objUnprotected, PROTECTED, ProtectedAttributes, rgbProtected, UNPROTECTED, UnprotectedAttributes
-
-
Constructor Summary
Constructors Constructor Description MACMessage()
-
Method Summary
Modifier and Type Method Description voidaddRecipient(Recipient recipient)voidCreate()voidDecodeFromCBORObject(com.upokecenter.cbor.CBORObject obj)Given a CBOR tree, parse the message.protected com.upokecenter.cbor.CBORObjectEncodeCBORObject()Encode the COSE message object to a CBORObject tree.RecipientgetRecipient(int iRecipient)intgetRecipientCount()List<Recipient>getRecipientList()booleanValidate(Recipient recipientToUse)-
Methods inherited from class COSE.MacCommon
AES_CBC_MAC, CreateWithKey, Validate
-
Methods inherited from class COSE.Message
addCountersignature, DecodeFromBytes, DecodeFromBytes, EncodeToBytes, EncodeToCBORObject, GetContent, getCountersign1, getCountersignerList, HasContent, ProcessCounterSignatures, SetContent, SetContent, setCountersign1, validate, validate
-
Methods inherited from class COSE.Attribute
addAttribute, addAttribute, addAttribute, AddProtected, AddProtected, AddProtected, AddUnprotected, AddUnprotected, AddUnprotected, findAttribute, findAttribute, findAttribute, findAttribute, getDoNotSendAttributes, getExternal, getProtectedAttributes, getUnprotectedAttributes, removeAttribute, removeAttribute, setExternal
-
-
-
-
Method Detail
-
addRecipient
public void addRecipient(Recipient recipient) throws CoseException
- Throws:
CoseException
-
getRecipient
public Recipient getRecipient(int iRecipient)
-
getRecipientCount
public int getRecipientCount()
-
DecodeFromCBORObject
public void DecodeFromCBORObject(com.upokecenter.cbor.CBORObject obj) throws CoseExceptionDescription copied from class:MessageGiven a CBOR tree, parse the message. This is an abstract function that is implemented for each different supported COSE message.- Specified by:
DecodeFromCBORObjectin classMessage- Parameters:
obj- CBORObject to be converted to a message.- Throws:
CoseException- Internal COSE Exception
-
EncodeCBORObject
protected com.upokecenter.cbor.CBORObject EncodeCBORObject() throws CoseExceptionDescription copied from class:MessageEncode the COSE message object to a CBORObject tree. This function call will force cryptographic operations to be executed as needed. This is an internal function, as such it does not add the tag on the front and is implemented on a per message object.- Specified by:
EncodeCBORObjectin classMessage- Returns:
- CBORObject representing the message.
- Throws:
CoseException- Internal COSE Exception
-
Validate
public boolean Validate(Recipient recipientToUse) throws CoseException, Exception
- Throws:
CoseExceptionException
-
Create
public void Create() throws CoseException, IllegalStateException, Exception
-
-