equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 1997, 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. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
24 */ |
24 */ |
25 |
25 |
26 package javax.crypto.spec; |
26 package javax.crypto.spec; |
27 |
27 |
28 import java.security.spec.KeySpec; |
28 import java.security.spec.KeySpec; |
|
29 import java.util.Arrays; |
29 |
30 |
30 /** |
31 /** |
31 * A user-chosen password that can be used with password-based encryption |
32 * A user-chosen password that can be used with password-based encryption |
32 * (<i>PBE</i>). |
33 * (<i>PBE</i>). |
33 * |
34 * |
172 * Clears the internal copy of the password. |
173 * Clears the internal copy of the password. |
173 * |
174 * |
174 */ |
175 */ |
175 public final void clearPassword() { |
176 public final void clearPassword() { |
176 if (password != null) { |
177 if (password != null) { |
177 for (int i = 0; i < password.length; i++) { |
178 Arrays.fill(password, ' '); |
178 password[i] = ' '; |
|
179 } |
|
180 password = null; |
179 password = null; |
181 } |
180 } |
182 } |
181 } |
183 |
182 |
184 /** |
183 /** |