public class DesKeyFactory extends SecretKeyFactory
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
ALGORITHM_NAME
The name of the key algorithm.
|
pkcs11KeySpec_, pkcs11OperationInitialized_, session_, softwareDelegate_, tokenManager_
Constructor and Description |
---|
DesKeyFactory()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected iaik.pkcs.pkcs11.objects.Object |
createKeyCreationTemplate(java.security.spec.KeySpec keySpec)
Create the key template to use as input for the object creation.
|
protected java.lang.String |
getAlgorithmName()
Get the (default) algorithm name of this factory.
|
protected boolean |
isAlgorithmAccepted(java.lang.String algorithmName)
Check, if this factory can handle keys of the algorithm given by its name.
|
protected java.security.spec.KeySpec |
pkcs11GetKeySpec(javax.crypto.SecretKey key,
java.lang.Class keySpecClass)
Returns a specification (key material) of the given key object.
|
protected void |
validateKeySpec(java.security.spec.KeySpec keySpec)
Check, if this factory can handle the given key specification.
|
extractKeyMaterial, getSoftwareDelegateAlgorithm, isFormatAccepted, pkcs11GenerateSecret
createKey, engineGenerateSecret, engineGetKeySpec, engineTranslateKey, finalize, finalizePkcs11Operation, initializePkcs11Operation, initializeSession, initializeSoftwareDelegate, isSessionAppropriate, isSupportedBy, pkcs11TranslateKey
protected static final java.lang.String ALGORITHM_NAME
protected iaik.pkcs.pkcs11.objects.Object createKeyCreationTemplate(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecException
createKeyCreationTemplate
in class SecretKeyFactory
keySpec
- The key spec providing algorithm specific key attributes.java.security.spec.InvalidKeySpecException
- If the given key material is inapropriate for this factory.protected java.security.spec.KeySpec pkcs11GetKeySpec(javax.crypto.SecretKey key, java.lang.Class keySpecClass) throws java.security.spec.InvalidKeySpecException
keySpec
identifies
the specification class in which the key material should be returned. It could, for example, be
SecretKeySpec.class
, to indicate that the key material should be returned in an
instance of the SecretKeySpec
class.pkcs11GetKeySpec
in class SecretKeyFactory
key
- The key.keySpecClass
- The specification class in which the key material should be returned.java.security.spec.InvalidKeySpecException
- if the requested key specification is inappropriate for the given key, or the
given key cannot be dealt with (e.g., the given key has an unrecognized format).protected java.lang.String getAlgorithmName()
getAlgorithmName
in class PKCS11SecretKeyFactory
protected boolean isAlgorithmAccepted(java.lang.String algorithmName)
isAlgorithmAccepted
in class SecretKeyFactory
algorithmName
- The name of the key algorithm.protected void validateKeySpec(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecException
InvalidKeySpecException
if the given keySpec
is invalid.validateKeySpec
in class SecretKeyFactory
keySpec
- The key specification.java.security.spec.InvalidKeySpecException
- If the requested key specification is inappropriate for the given key, or the
given key cannot be dealt with (e.g., the given key has an unrecognized format).IAIK JavaSecurity Website https://jce.iaik.tugraz.at/
IAIK at Graz University of Technology, Austria, Europe
Copyright 2001-2023 IAIK, Graz University of Technology, Inffeldgasse 16a, 8010 Graz, Austria. All Rights Reserved. Version 1.9.4