Bydon

Untitled

Jul 22nd, 2015
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. package com.direnode.forgevotifier.cryptography;
  2.  
  3. import java.security.KeyPair;
  4. import java.security.KeyPairGenerator;
  5. import java.security.spec.RSAKeyGenParameterSpec;
  6.  
  7. public class KeyGenerator {
  8.  
  9. public static KeyPair generate() throws Exception{
  10. KeyPairGenerator keygen = KeyPairGenerator.getInstance("RSA");
  11. RSAKeyGenParameterSpec spec = new RSAKeyGenParameterSpec(2048, RSAKeyGenParameterSpec.F4);
  12. keygen.initialize(spec);
  13. return keygen.generateKeyPair();
  14. }
  15.  
  16. }
Advertisement
Add Comment
Please, Sign In to add comment