Set the key on the object, if there is not a signature on this object then set
the algorithm and the key id from the key if they exist on the key and do not exist in the message.

@param key key to be used]
166475
private void setupKey(OneKey key) throws CoseException {
        CBORObject cn2;
        CBORObject cn;
        
        cnKey = key;

        if (rgbSignature != null) return;
        
        cn = key.get(KeyKeys.Algorithm);
        if (cn != null) {
            cn2 = findAttribute(HeaderKeys.Algorithm);
            if (cn2 == null) addAttribute(HeaderKeys.Algorithm, cn, Attribute.PROTECTED);
        }
        
        cn = key.get(KeyKeys.KeyId);
        if (cn != null) {
            cn2 = findAttribute(HeaderKeys.KID);
            if (cn2 == null) addAttribute(HeaderKeys.KID, cn, Attribute.UNPROTECTED);
        }
    }
775555
public static void set(String key, String value) {
        PROPS.get().setProperty(key, value);
    }
557224
private void key(final byte key[]) {
        int i;
        final int koffp[] = {0};
        final int lr[] = {0, 0};
        final int plen = P.length, slen = S.length;

        for (i = 0; i < plen; i++) {
            P[i] = P[i] ^ streamtoword(key, koffp);
        }

        for (i = 0; i < plen; i += 2) {
            encipher(lr, 0);
            P[i] = lr[0];
            P[i + 1] = lr[1];
        }

        for (i = 0; i < slen; i += 2) {
            encipher(lr, 0);
            S[i] = lr[0];
            S[i + 1] = lr[1];
        }
    }
27189
@Override
    public Builder signWith(String algorithm, Key key) throws KeyException {

        if (algorithm == null || algorithm.isEmpty() || !algorithm.equals(Constants.SIGNATURE_ALG_RS256)) {
            String err = Tr.formatMessage(tc, "JWT_INVALID_ALGORITHM_ERR", new Object[] { algorithm, Constants.SIGNATURE_ALG_RS256 });
            throw new KeyException(err);
        }
        if (key == null || !(key instanceof RSAPrivateKey)) {
            String err = Tr.formatMessage(tc, "JWT_INVALID_KEY_ERR", new Object[] { algorithm, key });
            throw new KeyException(err);
        }
        alg = algorithm;
        privateKey = key;
        return this;
    }
1264470
public void removeKey(String key) {
        if (key != null && !key.isEmpty()) {
            for (int i=0; i<map.size(); i++) {
                KeyValue kv = map.get(i);
                if (key.equals(kv.getKey())) {
                    map.remove(i);
                    return;
                }
            }
        }
    }
569919
public void setKey(org.openprovenance.prov.model.Key value) {
        this.key = (org.openprovenance.prov.sql.Key)value;
    }
10859
private static void validateKey(String key) {
		if (key == null || key.length() > MAX_KEY_SIZE) {
			throw new IllegalArgumentException("Invalid key - must be non null and have a length less than " + MAX_KEY_SIZE);
		}
	}
1084557
public final void updateKey(String key) throws IOException {
    Objects.requireNonNull(key, "old key required");
    if (index.containsKey(key)) {
      MtasSolrStatus status = index.get(key);
      index.remove(key);
      if (!index.containsKey(status.key())) {
        index.put(status.key(), status);
      } else {
        throw new IOException("key already exists");
      }
    }
  }
539940
def initialize_key(self, key):
        
        self.k = key
        self.n = 0
        if self.has_key():
            self.cipher.initialize(key)
511873
public void setValue(String key, String value) {
        KeyValue kv = getKV(key);
        if (kv != null) {
            kv.setValue(value);
        } else if (key != null) {
            map.add(new KeyValue(key,value));
        }
    }
188596
public void setKey(com.google.api.ads.adwords.axis.v201809.cm.MediaSize key) {
        this.key = key;
    }
846833
public synchronized void setKey(int i, int key) {

        if (i < 0 || i >= count) {
            throw new IndexOutOfBoundsException();
        }

        if (!sortOnValues) {
            sorted = false;
        }

        keys[i] = key;
    }
637318
static void incrementKey(byte[] key)
  {
    for (int i = key.length - 1; i >= 0; i--) {
      int v = key[i] & 0xff;
      
      if (v < 0xff) {
        key[i] = (byte) (v + 1);
        return;
      }
      
      key[i] = 0;
    }
  }
1357291
public void setSigningKey(String key) {
		Assert.hasText(key);
		key = key.trim();

		this.signingKey = key;

		if (isPublic(key)) {
			signer = new RsaSigner(key);
			logger.info("Configured with RSA signing key");
		}
		else {
			// Assume it's a MAC key
			this.verifierKey = key;
			signer = new MacSigner(key);
		}
	}
230697
def set_key(self, key='C'):
        """"""
        if isinstance(key, Key):
            key = key.name[0]
        self.track_data += self.key_signature_event(key)
440940
private void syncKeyLocked(String key) {
    ApiType obj = this.knownObjects.getByKey(key);
    if (obj == null) {
      return;
    }

    String id = this.keyOf(obj);
    Deque<MutablePair<DeltaType, Object>> deltas = this.items.get(id);
    if (deltas != null && !(Collections.isEmptyCollection(deltas))) {
      return;
    }

    this.queueActionLocked(DeltaType.Sync, obj);
  }
757874
public void set(String key, Object value) {
    if (!StringUtil.isEmpty(key) && null != value) {
      pendingInstanceData.put(key, value);
    }
  }