Bouncy Castle Cryptography Library 1.81

org.bouncycastle.jcajce
Class PKCS12KeyWithParameters

java.lang.Object
  extended byorg.bouncycastle.jcajce.PKCS12Key
      extended byorg.bouncycastle.jcajce.PKCS12KeyWithParameters
All Implemented Interfaces:
java.security.Key, javax.crypto.interfaces.PBEKey, PBKDFKey, javax.crypto.SecretKey, java.io.Serializable

public class PKCS12KeyWithParameters
extends PKCS12Key
implements javax.crypto.interfaces.PBEKey

A password based key for use with PKCS#12 with full PBE parameters.

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface java.security.Key
serialVersionUID
 
Constructor Summary
PKCS12KeyWithParameters(char[] password, boolean useWrongZeroLengthConversion, byte[] salt, int iterationCount)
          Basic constructor for a password based key with generation parameters, specifying the wrong conversion for zero length passwords.
PKCS12KeyWithParameters(char[] password, byte[] salt, int iterationCount)
          Basic constructor for a password based key with generation parameters.
 
Method Summary
 int getIterationCount()
          Return the iteration count to use in the key derivation function.
 byte[] getSalt()
          Return the salt to use in the key derivation function.
 
Methods inherited from class org.bouncycastle.jcajce.PKCS12Key
getAlgorithm, getEncoded, getFormat, getPassword
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.crypto.interfaces.PBEKey
getPassword
 
Methods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormat
 

Constructor Detail

PKCS12KeyWithParameters

public PKCS12KeyWithParameters(char[] password,
                               byte[] salt,
                               int iterationCount)
Basic constructor for a password based key with generation parameters.

Parameters:
password - password to use.
salt - salt for generation algorithm
iterationCount - iteration count for generation algorithm.

PKCS12KeyWithParameters

public PKCS12KeyWithParameters(char[] password,
                               boolean useWrongZeroLengthConversion,
                               byte[] salt,
                               int iterationCount)
Basic constructor for a password based key with generation parameters, specifying the wrong conversion for zero length passwords.

Parameters:
password - password to use.
salt - salt for generation algorithm
iterationCount - iteration count for generation algorithm.
useWrongZeroLengthConversion - use the incorrect encoding approach (add pad bytes)
Method Detail

getSalt

public byte[] getSalt()
Return the salt to use in the key derivation function.

Specified by:
getSalt in interface javax.crypto.interfaces.PBEKey
Returns:
the salt to use in the KDF.

getIterationCount

public int getIterationCount()
Return the iteration count to use in the key derivation function.

Specified by:
getIterationCount in interface javax.crypto.interfaces.PBEKey
Returns:
the iteration count to use in the KDF.

Bouncy Castle Cryptography Library 1.81