public class RsaKeyFactory extends PKCS11KeyFactory
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
KEY_FACTORY_ALGORITHM_NAME
The JCA standard name of this signature algorithm.
|
static int |
PKCS1_VERSION
The PKCS#1 version field in the ASN.1 encoding.
|
pkcs11KeySpec_, pkcs11OperationInitialized_, PKCS8_VERSION, session_, softwareDelegate_, tokenManager_
Constructor and Description |
---|
RsaKeyFactory()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected java.lang.String |
getAlgorithmName()
Return the JCA standard name of this key factory algorithm.
|
protected java.lang.String |
getSoftwareDelegateAlgorithm()
Return the name of the software algorithm to use, if this object must use a software delegation
object.
|
protected java.security.PrivateKey |
pkcs11GeneratePrivate(java.security.spec.KeySpec keySpec)
Generates a private key object from the provided key specification (key material).
|
protected java.security.PublicKey |
pkcs11GeneratePublic(java.security.spec.KeySpec keySpec)
Generates a public key object from the provided key specification (key material).
|
protected java.security.spec.KeySpec |
pkcs11GetKeySpec(java.security.Key key,
java.lang.Class keySpecClass)
Returns a specification (key material) of the given key object.
|
protected void |
verifyPrivateCRTKeyExtractable(iaik.pkcs.pkcs11.objects.RSAPrivateKey key)
Verifies that the CRT components of the key are present and extractable; i.e.
|
protected void |
verifyPrivateKeyExtractable(iaik.pkcs.pkcs11.objects.RSAPrivateKey key)
Verifies that the components of the key are present and extractable; i.e.
|
protected void |
verifyPublicKeyExtractable(iaik.pkcs.pkcs11.objects.RSAPublicKey key)
Verifies that the components of the key are present and extractable; i.e.
|
createKey, engineGeneratePrivate, engineGeneratePublic, engineGetKeySpec, engineTranslateKey, finalize, finalizePkcs11Operation, initializePkcs11Operation, initializeSession, initializeSoftwareDelegate, isSessionAppropriate, isSupportedBy, pkcs11TranslateKey
public static final int PKCS1_VERSION
protected static java.lang.String KEY_FACTORY_ALGORITHM_NAME
protected java.lang.String getSoftwareDelegateAlgorithm()
getSoftwareDelegateAlgorithm
in class PKCS11KeyFactory
protected java.lang.String getAlgorithmName()
getAlgorithmName
in class PKCS11KeyFactory
protected java.security.PublicKey pkcs11GeneratePublic(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecException
pkcs11GeneratePublic
in class PKCS11KeyFactory
keySpec
- the specification (key material) of the public key.java.security.spec.InvalidKeySpecException
- if the given key specification is inappropriate for this key factory to produce a
public key.protected java.security.PrivateKey pkcs11GeneratePrivate(java.security.spec.KeySpec keySpec) throws java.security.spec.InvalidKeySpecException
pkcs11GeneratePrivate
in class PKCS11KeyFactory
keySpec
- the specification (key material) of the private key.java.security.spec.InvalidKeySpecException
- if the given key specification is inappropriate for this key factory to produce a
private key.protected java.security.spec.KeySpec pkcs11GetKeySpec(java.security.Key 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
RSAPublicKeySpec.class
, to indicate that the key material should be returned in an
instance of the RSAPublicKeySpec
class.pkcs11GetKeySpec
in class PKCS11KeyFactory
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 void verifyPublicKeyExtractable(iaik.pkcs.pkcs11.objects.RSAPublicKey key) throws NonExtractableComponentException, IAIKPkcs11Exception
key
- The key.NonExtractableComponentException
- If any attribute is sensitive.IAIKPkcs11Exception
- If any attribute is not present.protected void verifyPrivateKeyExtractable(iaik.pkcs.pkcs11.objects.RSAPrivateKey key) throws NonExtractableComponentException, IAIKPkcs11Exception
key
- The key.NonExtractableComponentException
- If any attribute is sensitive.IAIKPkcs11Exception
- If any attribute is not present.protected void verifyPrivateCRTKeyExtractable(iaik.pkcs.pkcs11.objects.RSAPrivateKey key) throws NonExtractableComponentException, IAIKPkcs11Exception
key
- The key.NonExtractableComponentException
- If any attribute is sensitive.IAIKPkcs11Exception
- If any attribute is not present.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