Package COSE
Class Recipient
- java.lang.Object
-
- COSE.Attribute
-
- COSE.Message
-
- COSE.Recipient
-
public class Recipient extends Message
- Author:
- jimsch
-
-
Field Summary
-
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 Recipient()
-
Method Summary
Modifier and Type Method Description voidaddRecipient(Recipient recipient)voidDecodeFromCBORObject(com.upokecenter.cbor.CBORObject objRecipient)Given a CBOR tree, parse the message.byte[]decrypt(AlgorithmID algCEK, Recipient recip)protected com.upokecenter.cbor.CBORObjectEncodeCBORObject()Encode the COSE message object to a CBORObject tree.voidencrypt()byte[]getKey(AlgorithmID algCEK)RecipientgetRecipient(int iRecipient)intgetRecipientCount()List<Recipient>getRecipientList()intgetRecipientType()voidSetKey(com.upokecenter.cbor.CBORObject key)Deprecated.In COSE 0.9.1, use SetKey(OneKey)voidSetKey(OneKey key)Set the key for encrypting/decrypting the recipient key.voidSetSenderKey(com.upokecenter.cbor.CBORObject key)Deprecated.voidSetSenderKey(OneKey key)-
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
-
DecodeFromCBORObject
public void DecodeFromCBORObject(com.upokecenter.cbor.CBORObject objRecipient) 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:
objRecipient- 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
-
decrypt
public byte[] decrypt(AlgorithmID algCEK, Recipient recip) throws CoseException
- Throws:
CoseException
-
encrypt
public void encrypt() throws CoseException- Throws:
CoseException
-
addRecipient
public void addRecipient(Recipient recipient)
-
getRecipient
public Recipient getRecipient(int iRecipient)
-
getRecipientCount
public int getRecipientCount()
-
getRecipientType
public int getRecipientType() throws CoseException- Throws:
CoseException
-
getKey
public byte[] getKey(AlgorithmID algCEK) throws CoseException
- Throws:
CoseException
-
SetKey
@Deprecated public void SetKey(com.upokecenter.cbor.CBORObject key) throws CoseException
Deprecated.In COSE 0.9.1, use SetKey(OneKey)Set the key for encrypting/decrypting the recipient key.- Parameters:
key- private key for encrypting or decrypting- Throws:
CoseException- Internal COSE package error.
-
SetKey
public void SetKey(OneKey key)
Set the key for encrypting/decrypting the recipient key.- Parameters:
key- private key for encrypting or decrypting
-
SetSenderKey
@Deprecated public void SetSenderKey(com.upokecenter.cbor.CBORObject key) throws CoseException
Deprecated.- Throws:
CoseException
-
SetSenderKey
public void SetSenderKey(OneKey key)
-
-