Class SigStructure
java.lang.Object
com.authlete.cbor.CBORItem
com.authlete.cbor.CBORItemList
com.authlete.cose.SigStructure
Sig Signature
This class represents Sig_structure
which is defined in 4.4. Signing and
Verification Process of RFC 9052 as follows.
Sig_structure = [ context : "Signature" / "Signature1", body_protected : empty_or_serialized_map, ? sign_protected : empty_or_serialized_map, external_aad : bstr, payload : bstr ]
- Since:
- 1.1
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSigStructure
(COSEProtectedHeader bodyAttributes, CBORByteArray externalData, CBORByteArray payload) A constructor with the protected header of the content, the external data and the payload.SigStructure
(COSEProtectedHeader bodyAttributes, COSEProtectedHeader signerAttributes, CBORByteArray externalData, CBORByteArray payload) A constructor with the protected header of the content, the protected header ofCOSE_Signature
, the external data and the payload. -
Method Summary
Modifier and TypeMethodDescriptionGet the protected header of the content.Get the context.Get the external data.Get the payload.Get the protected header ofCOSE_Signature
.boolean
Check if the context is"Signature"
.boolean
Check if the context is"Signature1"
.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
-
SigStructure
public SigStructure(COSEProtectedHeader bodyAttributes, COSEProtectedHeader signerAttributes, CBORByteArray externalData, CBORByteArray payload) A constructor with the protected header of the content, the protected header ofCOSE_Signature
, the external data and the payload.This constructor is for
COSE_Sign
.- Parameters:
bodyAttributes
- The protected header of the content. Must not be null.signerAttributes
- The protected header ofCOSE_Signature
. Must not be null.externalData
- The external data.payload
- The payload.
-
SigStructure
public SigStructure(COSEProtectedHeader bodyAttributes, CBORByteArray externalData, CBORByteArray payload) A constructor with the protected header of the content, the external data and the payload.This constructor is for
COSE_Sign1
.- Parameters:
bodyAttributes
- The protected header of the content. Must not be null.externalData
- The external data.payload
- The payload.
-
-
Method Details
-
getContext
Get the context.- Returns:
- A
CBORString
representing either"Signature"
or"Signature1"
.
-
getBodyAttributes
Get the protected header of the content.- Returns:
- The protected header of the content.
-
getSignerAttributes
Get the protected header ofCOSE_Signature
.Note that this is not available when the context is
"Signature1"
.- Returns:
- The protected header of
COSE_Signature
.
-
getExternalData
-
getPayload
-
isSignature
public boolean isSignature()Check if the context is"Signature"
.- Returns:
true
if the context is"Signature"
.
-
isSignature1
public boolean isSignature1()Check if the context is"Signature1"
.- Returns:
true
if the context is"Signature1"
.
-