Guest User

Untitled

a guest
Jul 19th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. File file = new File(nomeFich + File.separator + "public.key");
  2. File file2 = new File(nomeFich + File.separator + "private.key");
  3.  
  4. KeyPair keyPair = KeyPair.createKeyPair();
  5.  
  6. DataOutputStream dos = new DataOutputStream(new FileOutputStream(file));
  7.  
  8. dos = new DataOutputStream(new FileOutputStream(file));
  9. dos.write(keyPair.getPublic().exportKey());
  10. dos.close();
  11.  
  12. dos = new DataOutputStream(new FileOutputStream(file2));
  13. dos.write(keyPair.getPrivate().exportKey());
  14. dos.close();
Add Comment
Please, Sign In to add comment