Skip to content

Most visited

Recently visited

navigation
Added in API level 1

KeyStore.PasswordProtection

public static class KeyStore.PasswordProtection
extends Object implements KeyStore.ProtectionParameter, Destroyable

java.lang.Object
   ↳ java.security.KeyStore.PasswordProtection


PasswordProtection is a ProtectionParameter that protects a KeyStore using a password.

Summary

Public constructors

KeyStore.PasswordProtection(char[] password)

Constructs a new instance of PasswordProtection with a password.

Public methods

void destroy()

Destroys / invalidates the password.

char[] getPassword()

Returns the password.

boolean isDestroyed()

Indicates whether the password is invalidated.

Inherited methods

From class java.lang.Object
From interface javax.security.auth.Destroyable

Public constructors

KeyStore.PasswordProtection

Added in API level 1
KeyStore.PasswordProtection (char[] password)

Constructs a new instance of PasswordProtection with a password. A copy of the password is stored in the new PasswordProtection object.

Parameters
password char: the password, maybe null.

Public methods

destroy

Added in API level 1
void destroy ()

Destroys / invalidates the password.

Throws
DestroyFailedException if the password could not be invalidated.

getPassword

Added in API level 1
char[] getPassword ()

Returns the password.

Returns
char[] the password.
Throws
IllegalStateException if the password has been destroyed.

isDestroyed

Added in API level 1
boolean isDestroyed ()

Indicates whether the password is invalidated.

Returns
boolean true if the password is invalidated, false otherwise.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.