Package COSE
Class EncryptMessage
- java.lang.Object
-
- COSE.Attribute
-
- COSE.Message
-
- COSE.EncryptCommon
-
- COSE.EncryptMessage
-
public class EncryptMessage extends EncryptCommon
- Author:
- jimsch
-
-
Field Summary
Fields Modifier and Type Field Description protected List<Recipient>recipientList-
Fields inherited from class COSE.EncryptCommon
context, rgbEncrypt
-
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 EncryptMessage()EncryptMessage(boolean emitTag)
-
Method Summary
Modifier and Type Method Description voidaddRecipient(Recipient recipient)voidDecodeFromCBORObject(com.upokecenter.cbor.CBORObject obj)Given a CBOR tree, parse the message.byte[]decrypt(Recipient whom)protected com.upokecenter.cbor.CBORObjectEncodeCBORObject()Encode the COSE message object to a CBORObject tree.voidencrypt()RecipientgetRecipient(int iRecipient)intgetRecipientCount()List<Recipient>getRecipientList()-
Methods inherited from class COSE.EncryptCommon
decryptWithKey, getEncryptedContent, ProcessCounterSignatures, setEncryptedContent, validate, validate
-
Methods inherited from class COSE.Message
addCountersignature, DecodeFromBytes, DecodeFromBytes, EncodeToBytes, EncodeToCBORObject, GetContent, getCountersign1, getCountersignerList, HasContent, SetContent, SetContent, setCountersign1
-
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)
-
getRecipient
public Recipient getRecipient(int iRecipient)
-
getRecipientCount
public int getRecipientCount()
-
decrypt
public byte[] decrypt(Recipient whom) throws CoseException
- Throws:
CoseException
-
encrypt
public void encrypt() throws CoseException, IllegalStateException, Exception
-
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
-
-