code: public void setKey(String key) throws IOException {
      if (this.key != null) {
        throw new IOException("key already set");
      } else {
        this.key = Objects.requireNonNull(key, "key required");
      }
    }
docs: Sets the key.
  
  @param key
  the new key
  @throws IOException
  Signals that an I/O exception has occurred.