equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2007, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 2011, 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 |
23 * questions. |
23 * questions. |
24 */ |
24 */ |
25 |
25 |
26 package javax.crypto.spec; |
26 package javax.crypto.spec; |
27 |
27 |
28 import java.math.BigInteger; |
|
29 import java.security.spec.AlgorithmParameterSpec; |
28 import java.security.spec.AlgorithmParameterSpec; |
30 |
29 |
31 /** |
30 /** |
32 * This class specifies the set of parameters used with password-based |
31 * This class specifies the set of parameters used with password-based |
33 * encryption (PBE), as defined in the |
32 * encryption (PBE), as defined in the |
51 * to protect against subsequent modification. |
50 * to protect against subsequent modification. |
52 * @param iterationCount the iteration count. |
51 * @param iterationCount the iteration count. |
53 * @exception NullPointerException if <code>salt</code> is null. |
52 * @exception NullPointerException if <code>salt</code> is null. |
54 */ |
53 */ |
55 public PBEParameterSpec(byte[] salt, int iterationCount) { |
54 public PBEParameterSpec(byte[] salt, int iterationCount) { |
56 this.salt = (byte[])salt.clone(); |
55 this.salt = salt.clone(); |
57 this.iterationCount = iterationCount; |
56 this.iterationCount = iterationCount; |
58 } |
57 } |
59 |
58 |
60 /** |
59 /** |
61 * Returns the salt. |
60 * Returns the salt. |
62 * |
61 * |
63 * @return the salt. Returns a new array |
62 * @return the salt. Returns a new array |
64 * each time this method is called. |
63 * each time this method is called. |
65 */ |
64 */ |
66 public byte[] getSalt() { |
65 public byte[] getSalt() { |
67 return (byte[])this.salt.clone(); |
66 return this.salt.clone(); |
68 } |
67 } |
69 |
68 |
70 /** |
69 /** |
71 * Returns the iteration count. |
70 * Returns the iteration count. |
72 * |
71 * |