public static void create(OutputStream outputStream, String outFormat,
      InputStream inputStream, String inFormat, String masterKeyUri, String credentialPath)
      throws Exception {
    KeysetHandle handle = TinkeyUtil.getKeysetHandle(inputStream, inFormat, masterKeyUri,
        credentialPath);
    TinkeyUtil.writeKeyset(handle.getPublicKeysetHandle(), outputStream, outFormat, null, null);
  }
Extracts public keys from {@code inputStream} (using {@code credentialPath} and
{@code masterKeyUri} to decrypt if it is encrypted) and writes public keys to
{@code outputStream}.
tools/tinkey/src/main/java/com/google/crypto/tink/tinkey/CreatePublicKeysetCommand.java