public abstract class KBKDFParameterSpec extends NativeEnclosure implements java.security.spec.AlgorithmParameterSpec, java.security.spec.KeySpec
Modifier and Type | Field and Description |
---|---|
protected KBKDFDerivedKey[] |
additional_keys |
long |
derivedKeyAlgorithm |
int |
keySize |
protected KBKDFDataParameter[] |
params |
protected long |
prf |
PK11SymKey |
prfKey |
mPointer, mPointerSize
Constructor and Description |
---|
KBKDFParameterSpec() |
Modifier and Type | Method and Description |
---|---|
protected void |
acquireNativeResources()
Allocate native resources, setting mPointer and mPointerSize as
appropriate.
|
protected abstract void |
acquireNativeResourcesInternal() |
void |
addAdditionalDerivedKey(KBKDFDerivedKey derived_key)
Append (to the end) a new derived key.
|
void |
addParameter(KBKDFDataParameter param)
Appends (to the end) a new data parameter.
|
protected void |
releaseNativeResources()
Called to deallocate native resources; note that mPointer.close()
is called afterwards.
|
protected abstract void |
releaseNativeResourcesInternal() |
void |
setAdditionalDerivedKeys(KBKDFDerivedKey[] additional_keys)
Set an array of additional derived keys.
|
void |
setDerivedKeyAlgorithm(long algo)
Sets the algorithm for the derived key from a PKCS#11 value; see
org.mozilla.jss.pkcs11.PKCS11Constants for constant values.
|
void |
setDerivedKeyAlgorithm(PKCS11Algorithm algo)
Set the algorithm for the derived key from a PKCS11Algorithm enum value.
|
void |
setKeySize(int keySize)
Set the size of the derived key.
|
void |
setParameters(KBKDFDataParameter[] params)
Set parameters for key derivation.
|
void |
setPRF(DigestAlgorithm prf)
Set the underlying pseudo-random function from a DigestAlgorithm
(HMACAlgorithm or CMACAlgorithm) instance.
|
void |
setPRF(long prf)
Set the underlying pseudo-random function from a PKCS#11 constant;
see org.mozilla.jss.pkcs11.PKCS11Constants for permitted values.
|
void |
setPRF(PKCS11Algorithm prf)
Set the underlying pseudo-random function from a PKCS11Algorithm enum
value.
|
void |
setPRFKey(javax.crypto.SecretKey key)
Set the base key used with the underlying PRF.
|
protected abstract void |
validateParameters()
Validate all class members prior to acquiring native resources.
|
close, finalize, open
public PK11SymKey prfKey
public long derivedKeyAlgorithm
public int keySize
protected long prf
protected KBKDFDataParameter[] params
protected KBKDFDerivedKey[] additional_keys
public void setPRF(PKCS11Algorithm prf) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setPRF(DigestAlgorithm prf) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setPRF(long prf)
public void setPRFKey(javax.crypto.SecretKey key) throws java.security.InvalidKeyException
java.security.InvalidKeyException
public void setDerivedKeyAlgorithm(PKCS11Algorithm algo) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setDerivedKeyAlgorithm(long algo) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setKeySize(int keySize)
public void setParameters(KBKDFDataParameter[] params) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void addParameter(KBKDFDataParameter param) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void setAdditionalDerivedKeys(KBKDFDerivedKey[] additional_keys) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public void addAdditionalDerivedKey(KBKDFDerivedKey derived_key) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
protected void acquireNativeResources() throws java.lang.Exception
NativeEnclosure
acquireNativeResources
in class NativeEnclosure
java.lang.Exception
protected void releaseNativeResources() throws java.lang.Exception
NativeEnclosure
releaseNativeResources
in class NativeEnclosure
java.lang.Exception
protected abstract void acquireNativeResourcesInternal() throws java.lang.Exception
java.lang.Exception
protected abstract void releaseNativeResourcesInternal() throws java.lang.Exception
java.lang.Exception
protected abstract void validateParameters() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException