Top Fields Constructors Methods
org.bouncycastle.jcajce.provider.symmetric.util

public Class BCPBEKey

extends Object
implements PBEKey, Destroyable
Class Inheritance
All Implemented Interfaces
javax.security.auth.Destroyable, javax.crypto.interfaces.PBEKey, javax.crypto.SecretKey, java.security.Key, java.io.Serializable
Imports
java.util.concurrent.atomic.AtomicBoolean, javax.crypto.interfaces.PBEKey, javax.crypto.spec.PBEKeySpec, javax.security.auth.Destroyable, org.bouncycastle.asn1.ASN1ObjectIdentifier, org.bouncycastle.crypto.CipherParameters, .PBEParametersGenerator, org.bouncycastle.crypto.params.KeyParameter, .ParametersWithIV, org.bouncycastle.util.Arrays

Field Summary

Modifier and TypeField and Description
pack-priv String
pack-priv int
private final AtomicBoolean
private final int
pack-priv int
pack-priv int
pack-priv ASN1ObjectIdentifier
private final CipherParameters
private final char[]
private final byte[]
pack-priv boolean
pack-priv int

Constructor Summary

AccessConstructor and Description
public
BCPBEKey(String algorithm, ASN1ObjectIdentifier oid, int type, int digest, int keySize, int ivSize, PBEKeySpec pbeKeySpec, CipherParameters param)

public

Method Summary

Modifier and TypeMethod and Description
pack-priv static void
public void
destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Destroy this Object.

public String
getAlgorithm()

Implements java.security.Key.getAlgorithm.

Returns the standard algorithm name for this key.

pack-priv int
public byte[]
getEncoded()

Implements java.security.Key.getEncoded.

Returns the key in its primary encoding format, or null if this key does not support encoding.

public String
getFormat()

Implements java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding.

public int
getIterationCount()

Implements javax.crypto.interfaces.PBEKey.getIterationCount.

Returns the iteration count or 0 if not specified.

public int
pack-priv int
public ASN1ObjectIdentifier
public CipherParameters
public char[]
getPassword()

Implements javax.crypto.interfaces.PBEKey.getPassword.

Returns the password.

public byte[]
getSalt()

Implements javax.crypto.interfaces.PBEKey.getSalt.

Returns the salt or null if not specified.

pack-priv int
public boolean
isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.

public void
setTryWrongPKCS12Zero(boolean tryWrong)

pack-priv boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmback to summary
pack-priv String algorithm
digestback to summary
pack-priv int digest
hasBeenDestroyedback to summary
private final AtomicBoolean hasBeenDestroyed
iterationCountback to summary
private final int iterationCount
ivSizeback to summary
pack-priv int ivSize
keySizeback to summary
pack-priv int keySize
oidback to summary
pack-priv ASN1ObjectIdentifier oid
paramback to summary
private final CipherParameters param
passwordback to summary
private final char[] password
saltback to summary
private final byte[] salt
tryWrongback to summary
pack-priv boolean tryWrong
typeback to summary
pack-priv int type

Constructor Detail

BCPBEKeyback to summary
public BCPBEKey(String algorithm, ASN1ObjectIdentifier oid, int type, int digest, int keySize, int ivSize, PBEKeySpec pbeKeySpec, CipherParameters param)
BCPBEKeyback to summary
public BCPBEKey(String algName, CipherParameters param)

Method Detail

checkDestroyedback to summary
pack-priv static void checkDestroyed(Destroyable destroyable)
destroyback to summary
public void destroy()

Overrides default javax.security.auth.Destroyable.destroy.

Doc from javax.security.auth.Destroyable.destroy.

Destroy this Object.

Sensitive information associated with this Object is destroyed or cleared. Subsequent calls to certain methods on this Object will result in an IllegalStateException being thrown.

getAlgorithmback to summary
public String getAlgorithm()

Implements java.security.Key.getAlgorithm.

Doc from java.security.Key.getAlgorithm.

Returns the standard algorithm name for this key. For example, "DSA" would indicate that this key is a DSA key. See the key related sections (KeyFactory, KeyGenerator, KeyPairGenerator, and SecretKeyFactory) in the Java Security Standard Algorithm Names Specification for information about standard key algorithm names.

Returns:String

the name of the algorithm associated with this key.

getDigestback to summary
pack-priv int getDigest()
getEncodedback to summary
public byte[] getEncoded()

Implements java.security.Key.getEncoded.

Doc from java.security.Key.getEncoded.

Returns the key in its primary encoding format, or null if this key does not support encoding.

Returns:byte[]

the encoded key, or null if the key does not support encoding.

getFormatback to summary
public String getFormat()

Implements java.security.Key.getFormat.

Doc from java.security.Key.getFormat.

Returns the name of the primary encoding format of this key, or null if this key does not support encoding. The primary encoding format is named in terms of the appropriate ASN.1 data format, if an ASN.1 specification for this key exists. For example, the name of the ASN.1 data format for public keys is SubjectPublicKeyInfo, as defined by the X.509 standard; in this case, the returned format is "X.509". Similarly, the name of the ASN.1 data format for private keys is PrivateKeyInfo, as defined by the PKCS #8 standard; in this case, the returned format is "PKCS#8".

Returns:String

the primary encoding format of the key.

getIterationCountback to summary
public int getIterationCount()

Implements javax.crypto.interfaces.PBEKey.getIterationCount.

Doc from javax.crypto.interfaces.PBEKey.getIterationCount.

Returns the iteration count or 0 if not specified.

Returns:int

the iteration count.

getIvSizeback to summary
public int getIvSize()
getKeySizeback to summary
pack-priv int getKeySize()
getOIDback to summary
public ASN1ObjectIdentifier getOID()
getParamback to summary
public CipherParameters getParam()
getPasswordback to summary
public char[] getPassword()

Implements javax.crypto.interfaces.PBEKey.getPassword.

Doc from javax.crypto.interfaces.PBEKey.getPassword.

Returns the password.

Note

this method should return a copy of the password. It is the caller's responsibility to zero out the password information after it is no longer needed.

Returns:char[]

the password.

getSaltback to summary
public byte[] getSalt()

Implements javax.crypto.interfaces.PBEKey.getSalt.

Doc from javax.crypto.interfaces.PBEKey.getSalt.

Returns the salt or null if not specified.

Note

this method should return a copy of the salt. It is the caller's responsibility to zero out the salt information after it is no longer needed.

Returns:byte[]

the salt.

getTypeback to summary
pack-priv int getType()
isDestroyedback to summary
public boolean isDestroyed()

Overrides default javax.security.auth.Destroyable.isDestroyed.

Doc from javax.security.auth.Destroyable.isDestroyed.

Determine if this Object has been destroyed.

Returns:boolean

true if this Object has been destroyed, false otherwise.

setTryWrongPKCS12Zeroback to summary
public void setTryWrongPKCS12Zero(boolean tryWrong)
shouldTryWrongPKCS12back to summary
pack-priv boolean shouldTryWrongPKCS12()