code: public void save(final SecretKey key) throws IOException {
          final File keyFile = getKeyPath(key);
          keyFile.getParentFile().mkdirs(); // make directories if they do not exist
          try (OutputStream fos = Files.newOutputStream(keyFile.toPath());
               ObjectOutputStream oout = new ObjectOutputStream(fos)) {
              oout.writeObject(key);
          }
      }
docs: Saves a secret key.
  
  @param key the SecretKey to save
  @throws IOException if the file cannot be written
  @since 1.0.0