code: public void addAttribute(CBORObject label, CBORObject value, int where) throws CoseException {
          removeAttribute(label);
          if ((label.getType() != CBORType.Number) &&  (label.getType() != CBORType.TextString)) {
              throw new CoseException("Labels must be integers or strings");
          }
          switch (where) {
              case PROTECTED:
                  if (rgbProtected != null) throw new CoseException("Cannot modify protected attribute if signature has been computed");
                  objProtected.Add(label, value);
                  break;
                  
              case UNPROTECTED:
                  objUnprotected.Add(label, value);
                  break;
                  
              case DO_NOT_SEND:
                  objDontSend.Add(label, value);
                  break;
                  
              default:
                  throw new CoseException("Invalid attribute location given");
          }
      }
docs: Set an attribute in the COSE object.
  Setting an attribute in one map will remove it from all other maps as a side effect.
  
  @param label CBOR object which identifies the attribute in the map
  @param value CBOR object which contains the value of the attribute
  @param where Identifies which of the buckets to place the attribute in.
  ProtectedAttributes - attributes cryptographically protected
  UnprotectedAttributes - attributes not cryptographically protected
  DontSendAttributes - attributes used locally and not transmitted
  @exception CoseException COSE Package exception