code: @Override
      protected CBORObject EncodeCBORObject() throws CoseException {
          if (rgbSignature == null) throw new CoseException("sign function not called");
          if (rgbProtected == null) throw new CoseException("Internal Error");
          
          CBORObject obj = CBORObject.NewArray();
          obj.Add(rgbProtected);        
          obj.Add(objUnprotected);
          if (emitContent) obj.Add(rgbContent);
          else obj.Add(null);
          obj.Add(rgbSignature);
          
          return obj;
      }
docs: Internal function used to create a serialization of a COSE_Sign1 message
  
  @return CBOR object which can be encoded.
  @throws CoseException Errors generated by the COSE module