Package org.bouncycastle.jcajce
Class PKCS12KeyWithParameters
java.lang.Object
org.bouncycastle.jcajce.PKCS12Key
org.bouncycastle.jcajce.PKCS12KeyWithParameters
- All Implemented Interfaces:
Serializable,Key,PBEKey,SecretKey,Destroyable,PBKDFKey
A password based key for use with PKCS#12 with full PBE parameters.
- See Also:
-
Field Summary
Fields inherited from interface javax.crypto.interfaces.PBEKey
serialVersionUIDFields inherited from interface javax.crypto.SecretKey
serialVersionUID -
Constructor Summary
ConstructorsConstructorDescriptionPKCS12KeyWithParameters(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
Modifier and TypeMethodDescriptionintReturn 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, getPasswordMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax.security.auth.Destroyable
destroy, isDestroyedMethods inherited from interface java.security.Key
getAlgorithm, getEncoded, getFormatMethods inherited from interface javax.crypto.interfaces.PBEKey
getPassword
-
Constructor Details
-
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 algorithmiterationCount- 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.useWrongZeroLengthConversion- use the incorrect encoding approach (add pad bytes)salt- salt for generation algorithmiterationCount- iteration count for generation algorithm.
-
-
Method Details
-
getSalt
public byte[] getSalt()Return the salt to use in the key derivation function. -
getIterationCount
public int getIterationCount()Return the iteration count to use in the key derivation function.- Specified by:
getIterationCountin interfacePBEKey- Returns:
- the iteration count to use in the KDF.
-