1 /* |
1 /* |
2 * Copyright (c) 1997, 2005, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2012, 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. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
60 * Algorithm-independent initialization using the <code>initialize</code> method |
60 * Algorithm-independent initialization using the <code>initialize</code> method |
61 * in the KeyPairGenerator |
61 * in the KeyPairGenerator |
62 * interface is all that is needed when you accept defaults for algorithm-specific |
62 * interface is all that is needed when you accept defaults for algorithm-specific |
63 * parameters. |
63 * parameters. |
64 * |
64 * |
|
65 * <p>Note: Some earlier implementations of this interface may not support |
|
66 * larger sizes of DSA parameters such as 2048 and 3072-bit. |
|
67 * |
65 * @see java.security.KeyPairGenerator |
68 * @see java.security.KeyPairGenerator |
66 */ |
69 */ |
67 public interface DSAKeyPairGenerator { |
70 public interface DSAKeyPairGenerator { |
68 |
71 |
69 /** |
72 /** |
76 * |
79 * |
77 * @param random the random bit source to use to generate key bits; |
80 * @param random the random bit source to use to generate key bits; |
78 * can be null. |
81 * can be null. |
79 * |
82 * |
80 * @exception InvalidParameterException if the <code>params</code> |
83 * @exception InvalidParameterException if the <code>params</code> |
81 * value is invalid or null. |
84 * value is invalid, null, or unsupported. |
82 */ |
85 */ |
83 public void initialize(DSAParams params, SecureRandom random) |
86 public void initialize(DSAParams params, SecureRandom random) |
84 throws InvalidParameterException; |
87 throws InvalidParameterException; |
85 |
88 |
86 /** |
89 /** |
95 * precomputed parameters for that modulus length, an exception will be |
98 * precomputed parameters for that modulus length, an exception will be |
96 * thrown. It is guaranteed that there will always be |
99 * thrown. It is guaranteed that there will always be |
97 * default parameters for modulus lengths of 512 and 1024 bits. |
100 * default parameters for modulus lengths of 512 and 1024 bits. |
98 * |
101 * |
99 * @param modlen the modulus length in bits. Valid values are any |
102 * @param modlen the modulus length in bits. Valid values are any |
100 * multiple of 8 between 512 and 1024, inclusive. |
103 * multiple of 64 between 512 and 1024, inclusive, 2048, and 3072. |
101 * |
104 * |
102 * @param random the random bit source to use to generate key bits; |
105 * @param random the random bit source to use to generate key bits; |
103 * can be null. |
106 * can be null. |
104 * |
107 * |
105 * @param genParams whether or not to generate new parameters for |
108 * @param genParams whether or not to generate new parameters for |
106 * the modulus length requested. |
109 * the modulus length requested. |
107 * |
110 * |
108 * @exception InvalidParameterException if <code>modlen</code> is not |
111 * @exception InvalidParameterException if <code>modlen</code> is |
109 * between 512 and 1024, or if <code>genParams</code> is false and |
112 * invalid, or unsupported, or if <code>genParams</code> is false and there |
110 * there are no precomputed parameters for the requested modulus |
113 * are no precomputed parameters for the requested modulus length. |
111 * length. |
|
112 */ |
114 */ |
113 public void initialize(int modlen, boolean genParams, SecureRandom random) |
115 public void initialize(int modlen, boolean genParams, SecureRandom random) |
114 throws InvalidParameterException; |
116 throws InvalidParameterException; |
115 } |
117 } |