Package COSE
Class EncryptCommon
- java.lang.Object
-
- COSE.Attribute
-
- COSE.Message
-
- COSE.EncryptCommon
-
- Direct Known Subclasses:
Encrypt0Message,EncryptMessage
public abstract class EncryptCommon extends Message
- Author:
- jimsch
-
-
Field Summary
Fields Modifier and Type Field Description protected Stringcontextprotected byte[]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 EncryptCommon()
-
Method Summary
Modifier and Type Method Description protected byte[]decryptWithKey(byte[] rgbKey)byte[]getEncryptedContent()Used to obtain the encrypted content for the cases where detached content is requested.protected voidProcessCounterSignatures()voidsetEncryptedContent(byte[] rgb)Set the encrypted content for detached content cases.booleanvalidate(CounterSign countersignature)booleanvalidate(CounterSign1 countersignature)-
Methods inherited from class COSE.Message
addCountersignature, DecodeFromBytes, DecodeFromBytes, DecodeFromCBORObject, EncodeCBORObject, 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
-
-
-
-
Field Detail
-
context
protected String context
-
rgbEncrypt
protected byte[] rgbEncrypt
-
-
Method Detail
-
decryptWithKey
protected byte[] decryptWithKey(byte[] rgbKey) throws CoseException- Throws:
CoseException
-
getEncryptedContent
public byte[] getEncryptedContent() throws CoseExceptionUsed to obtain the encrypted content for the cases where detached content is requested.- Returns:
- bytes of the encrypted content
- Throws:
CoseException- if content has not been encrypted
-
setEncryptedContent
public void setEncryptedContent(byte[] rgb)
Set the encrypted content for detached content cases.- Parameters:
rgb- encrypted content to be used
-
ProcessCounterSignatures
protected void ProcessCounterSignatures() throws CoseException- Overrides:
ProcessCounterSignaturesin classMessage- Throws:
CoseException
-
validate
public boolean validate(CounterSign1 countersignature) throws CoseException
- Overrides:
validatein classMessage- Throws:
CoseException
-
validate
public boolean validate(CounterSign countersignature) throws CoseException
- Overrides:
validatein classMessage- Throws:
CoseException
-
-