KeyStore.PasswordProtection
public
static
class
KeyStore.PasswordProtection
extends Object
implements
KeyStore.ProtectionParameter,
Destroyable
| java.lang.Object | |
| ↳ | java.security.KeyStore.PasswordProtection |
A password-based implementation of ProtectionParameter.
Summary
Public constructors | |
|---|---|
KeyStore.PasswordProtection(char[] password)
Creates a password parameter. |
|
Public methods | |
|---|---|
void
|
destroy()
Clears the password. |
char[]
|
getPassword()
Gets the password. |
boolean
|
isDestroyed()
Determines if password has been cleared. |
Inherited methods | |
|---|---|
java.lang.Object
| |
javax.security.auth.Destroyable
| |
Public constructors
KeyStore.PasswordProtection
KeyStore.PasswordProtection (char[] password)
Creates a password parameter.
The specified password is cloned before it is stored
in the new PasswordProtection object.
| Parameters | |
|---|---|
password |
char:
the password, which may be null
|
Public methods
destroy
void destroy ()
Clears the password.
| Throws | |
|---|---|
|
if this method was unable to clear the password |
DestroyFailedException |
|
getPassword
char[] getPassword ()
Gets the password.
Note that this method returns a reference to the password. If a clone of the array is created it is the caller's responsibility to zero out the password information after it is no longer needed.
| Returns | |
|---|---|
char[] |
the password, which may be null |
| Throws | |
|---|---|
IllegalStateException |
if the password has been cleared (destroyed) |
See also:
isDestroyed
boolean isDestroyed ()
Determines if password has been cleared.
| Returns | |
|---|---|
boolean |
true if the password has been cleared, false otherwise |
Interfaces
Classes
- AccessControlContext
- AccessController
- AlgorithmParameterGenerator
- AlgorithmParameterGeneratorSpi
- AlgorithmParameters
- AlgorithmParametersSpi
- AllPermission
- AuthProvider
- BasicPermission
- CodeSigner
- CodeSource
- DigestInputStream
- DigestOutputStream
- GuardedObject
- Identity
- IdentityScope
- KeyFactory
- KeyFactorySpi
- KeyPair
- KeyPairGenerator
- KeyPairGeneratorSpi
- KeyRep
- KeyStore
- KeyStore.Builder
- KeyStore.CallbackHandlerProtection
- KeyStore.PasswordProtection
- KeyStore.PrivateKeyEntry
- KeyStore.SecretKeyEntry
- KeyStore.TrustedCertificateEntry
- KeyStoreSpi
- MessageDigest
- MessageDigestSpi
- Permission
- PermissionCollection
- Permissions
- Policy
- PolicySpi
- ProtectionDomain
- Provider
- Provider.Service
- SecureClassLoader
- SecureRandom
- SecureRandomSpi
- Security
- SecurityPermission
- Signature
- SignatureSpi
- SignedObject
- Signer
- Timestamp
- UnresolvedPermission
Enums
Exceptions
- AccessControlException
- DigestException
- GeneralSecurityException
- InvalidAlgorithmParameterException
- InvalidKeyException
- InvalidParameterException
- KeyException
- KeyManagementException
- KeyStoreException
- NoSuchAlgorithmException
- NoSuchProviderException
- PrivilegedActionException
- ProviderException
- SignatureException
- UnrecoverableEntryException
- UnrecoverableKeyException

