@Test public void testCompare() throws Exception { PrivateKey key1 = PVK.parse(new File("src/test/resources/keystores/privatekey.pvk"), "password"); PrivateKey key2 = PVK.parse(new File("src/test/resources/keystores/privatekey-encrypted.pvk"), "password"); assertEquals(key1, key2); }
public static PrivateKey parse(File file, String password) throws GeneralSecurityException, IOException { ByteBuffer buffer = ByteBuffer.allocate((int) file.length()); try (FileInputStream in = new FileInputStream(file)) { in.getChannel().read(buffer); return parse(buffer, password); } }
PVK { public static PrivateKey parse(File file, String password) throws GeneralSecurityException, IOException { ByteBuffer buffer = ByteBuffer.allocate((int) file.length()); try (FileInputStream in = new FileInputStream(file)) { in.getChannel().read(buffer); return parse(buffer, password); } } }
PVK { public static PrivateKey parse(File file, String password) throws GeneralSecurityException, IOException { ByteBuffer buffer = ByteBuffer.allocate((int) file.length()); try (FileInputStream in = new FileInputStream(file)) { in.getChannel().read(buffer); return parse(buffer, password); } } private  PVK(); }
PVK { public static PrivateKey parse(File file, String password) throws GeneralSecurityException, IOException { ByteBuffer buffer = ByteBuffer.allocate((int) file.length()); try (FileInputStream in = new FileInputStream(file)) { in.getChannel().read(buffer); return parse(buffer, password); } } private  PVK(); static PrivateKey parse(File file, String password); static PrivateKey parse(ByteBuffer buffer, String password); }
PVK { public static PrivateKey parse(File file, String password) throws GeneralSecurityException, IOException { ByteBuffer buffer = ByteBuffer.allocate((int) file.length()); try (FileInputStream in = new FileInputStream(file)) { in.getChannel().read(buffer); return parse(buffer, password); } } private  PVK(); static PrivateKey parse(File file, String password); static PrivateKey parse(ByteBuffer buffer, String password);  }