Class COSERecipient
java.lang.Object
com.authlete.cbor.CBORItem
com.authlete.cbor.CBORItemList
com.authlete.cose.COSEObject
com.authlete.cose.COSERecipient
COSE_recipient
COSE_recipient
is defined in 5.1. Enveloped
COSE Structure of RFC 9052 as follows.
COSE_recipient = [ Headers, ciphertext : bstr / nil, ? recipients : [+COSE_recipient] ]
- Since:
- 1.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionCOSERecipient
(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem ciphertext) A constructor with a protected header, an unprotected header and a cipher text.COSERecipient
(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem ciphertext, CBORItemList recipients) A constructor with a protected header, an unprotected header, a cipher text and recipients. -
Method Summary
Modifier and TypeMethodDescriptionstatic COSERecipient
Interpret the given CBOR data item as a recipient and build an instance ofCOSERecipient
from it.static COSERecipient
Build aCOSERecipient
instance from the given object list.Get the cipher text.Get the list of recipients.Methods inherited from class com.authlete.cose.COSEObject
getProtectedHeader, getUnprotectedHeader
Methods inherited from class com.authlete.cbor.CBORItemList
encode, getItems, parse, prettify, toString
Methods inherited from class com.authlete.cbor.CBORItem
encode, encodeMajorWithNumber, encodeToBase64, encodeToBase64Url, encodeToHex, getComment, prettify, setComment, toString
-
Constructor Details
-
COSERecipient
public COSERecipient(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem ciphertext) A constructor with a protected header, an unprotected header and a cipher text.- Parameters:
protectedHeader
- A protected header. Must not be null.unprotectedHeader
- An unprotected header. Must not be null.ciphertext
- A cipher text. Must be eitherCBORByteArray
orCBORNull
.
-
COSERecipient
public COSERecipient(COSEProtectedHeader protectedHeader, COSEUnprotectedHeader unprotectedHeader, CBORItem ciphertext, CBORItemList recipients) A constructor with a protected header, an unprotected header, a cipher text and recipients.- Parameters:
protectedHeader
- A protected header. Must not be null.unprotectedHeader
- An unprotected header. Must not be null.ciphertext
- A cipher text. Must be eitherCBORByteArray
orCBORNull
.recipients
- Recipients. Must not be null. Items in the list must be instances ofCOSERecipient
. At least one element must be contained.
-
-
Method Details
-
getCiphertext
Get the cipher text.The type of the value is
CBORByteArray
orCBORNull
.- Returns:
- The cipher text.
-
getRecipients
Get the list of recipients. Items in the list areCOSERecipient
instances.- Returns:
- The list of recipients.
null
is returned if this instance was created without recipients.
-
build
Interpret the given CBOR data item as a recipient and build an instance ofCOSERecipient
from it.- Parameters:
item
- A CBOR data item that represents a recipient. It must be a CBOR array.- Returns:
- A recipient.
- Throws:
COSEException
- The given CBOR data item does not conform to the requirements of recipient.
-
build
Build aCOSERecipient
instance from the given object list.- Parameters:
list
- A object list that representsCOSE_recipient
.- Returns:
- A
COSERecipient
instance built from the given object list. - Throws:
COSEException
-