diff options
author | tholenst <tholenst@google.com> | 2023-02-08 07:42:43 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2023-02-08 07:43:51 -0800 |
commit | ee8e73e8417e9940258c790ead567d7ab880155f (patch) | |
tree | 7a389ed89ded29c2f3d9cb8a725f595f06be562e /tools | |
parent | 1306800e4a668e326d7984108c4b1eba574bf3c2 (diff) | |
download | tink-ee8e73e8417e9940258c790ead567d7ab880155f.tar.gz |
Inline BinaryKeyset{Reader,Writer}.withFile, following the @InlineMe annotation.
PiperOrigin-RevId: 508077491
Diffstat (limited to 'tools')
-rw-r--r-- | tools/testing/java/com/google/crypto/tink/testing/CliUtil.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/testing/java/com/google/crypto/tink/testing/CliUtil.java b/tools/testing/java/com/google/crypto/tink/testing/CliUtil.java index 3af1774e8..5c0f11bd1 100644 --- a/tools/testing/java/com/google/crypto/tink/testing/CliUtil.java +++ b/tools/testing/java/com/google/crypto/tink/testing/CliUtil.java @@ -26,7 +26,6 @@ import com.google.crypto.tink.prf.PrfConfig; import com.google.crypto.tink.signature.SignatureConfig; import com.google.crypto.tink.streamingaead.StreamingAeadConfig; import java.io.ByteArrayOutputStream; -import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; @@ -47,13 +46,15 @@ public final class CliUtil { public static KeysetHandle readKeyset(String filename) throws GeneralSecurityException, IOException { System.out.println("Reading the keyset..."); - return CleartextKeysetHandle.read(BinaryKeysetReader.withFile(new File(filename))); + return CleartextKeysetHandle.read( + BinaryKeysetReader.withInputStream(new FileInputStream(filename))); } /** Writes a keyset to the specified file. In case of errors throws an exception. */ public static void writeKeyset(KeysetHandle handle, String filename) throws IOException { System.out.println("Writing the keyset..."); - CleartextKeysetHandle.write(handle, BinaryKeysetWriter.withFile(new File(filename))); + CleartextKeysetHandle.write( + handle, BinaryKeysetWriter.withOutputStream(new FileOutputStream(filename))); } /** |