equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
38 |
38 |
39 KeyPairGenerator keyGen; |
39 KeyPairGenerator keyGen; |
40 try { |
40 try { |
41 keyGen = KeyPairGenerator.getInstance("EC", "SunEC"); |
41 keyGen = KeyPairGenerator.getInstance("EC", "SunEC"); |
42 ECGenParameterSpec brainpoolSpec = |
42 ECGenParameterSpec brainpoolSpec = |
43 new ECGenParameterSpec("brainpoolP256r1"); |
43 new ECGenParameterSpec("brainpoolP160r1"); |
44 keyGen.initialize(brainpoolSpec); |
44 keyGen.initialize(brainpoolSpec); |
45 } catch (InvalidAlgorithmParameterException ex) { |
45 } catch (InvalidAlgorithmParameterException ex) { |
46 System.out.println(ex.getMessage()); |
46 System.out.println(ex.getMessage()); |
47 // this is expected |
47 // this is expected |
48 return; |
48 return; |