public class IaikSecurity
extends java.lang.Object
getImplementation
method
is called for searching for a provider specific implementation of the requested
cryptographic object. If, for instance, a DES cipher implementation of the IAIK
provider would be requested the following program sequence will be performed:
IaikSecurity iaik = new IaikSecurity("DES", "Cipher", "IAIK"); CipherSpi cipher_spi = (CipherSpi)iaik.getImplementation();
Constructor and Description |
---|
IaikSecurity(java.lang.String algorithm,
java.lang.String type,
java.lang.String provider)
Creates an IaikSecurity object to search for a algorithm
of the given type, implemented by the given provider.
|
Modifier and Type | Method and Description |
---|---|
static javax.crypto.Cipher |
getCipher(java.lang.String algorithm)
Gets a Cipher instance for the requested algorithm from the IAIK provider.
|
static javax.crypto.Cipher |
getCipher(java.lang.String algorithm,
int mode,
java.security.Key key,
java.security.spec.AlgorithmParameterSpec params,
java.security.SecureRandom random)
Gets and inits a Cipher instance for the requested algorithm from the IAIK provider.
|
static javax.crypto.Cipher |
getCipher(java.lang.String algorithm,
int mode,
java.security.Key key,
java.security.AlgorithmParameters params,
java.security.SecureRandom random)
Gets and inits a Cipher instance for the requested algorithm from the IAIK provider.
|
java.lang.Object |
getImplementation()
Tries to find an implemenation for a specific algorithm.
|
java.security.Provider |
getProvider()
Returns the provider implementing the actual algorithm
|
public IaikSecurity(java.lang.String algorithm, java.lang.String type, java.lang.String provider)
algorithm
- the name of the algorithm (or an alias)type
- the type of the algorithm e.g. Cipherprovider
- the desired provider or null if any provider is appropriatepublic java.lang.Object getImplementation() throws java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException
java.security.NoSuchAlgorithmException
- if no provider implements the algorithmjava.security.NoSuchProviderException
- if the provider does not existpublic java.security.Provider getProvider()
public static javax.crypto.Cipher getCipher(java.lang.String algorithm) throws javax.crypto.NoSuchPaddingException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException
This method may be called instead of Cipher.getInstance
to
create a Cipher from the IAIK provider. When using the signed unltd
iaik_jce_(full).jar
calling getCipher
allows
unlimited strength cryptography also when the default jursidiction policy
files are installed (see IAIK-JCE installation guidelines for more
information).
algorithm
- the Cipher algorithm (transformation)java.security.NoSuchProviderException
- if the IAIK provider has not been installedjava.security.NoSuchAlgorithmException
- if no implementation for the requested cipher
algorithm is availablejavax.crypto.NoSuchPaddingException
- if the requested padding scheme is not availablepublic static javax.crypto.Cipher getCipher(java.lang.String algorithm, int mode, java.security.Key key, java.security.spec.AlgorithmParameterSpec params, java.security.SecureRandom random) throws javax.crypto.NoSuchPaddingException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
This method may be called instead of Cipher.getInstance
to
create a Cipher from the IAIK provider. When using the signed unltd
iaik_jce_(full).jar
calling getCipher
allows
unlimited strength cryptography also when the default jursidiction policy
files are installed (see IAIK-JCE installation guidelines for more
information).
algorithm
- the Cipher algorithm (transformation)mode
- the Cipher mode to be used for initialization
(e.g. Cipher.ENCRYPT_MODE, Cipher.DECRYPT_MODE)key
- the key to be used for initialization; if not null
params
- any parameters to be used for initialization; if not null
random
- the SecureRandom to be used for initialization; if not null
java.security.NoSuchProviderException
- if the IAIK provider has not been installedjava.security.NoSuchAlgorithmException
- if no implementation for the requested cipher
algorithm is availablejavax.crypto.NoSuchPaddingException
- if no implementation for the given cipher
algorithm is availablejava.security.InvalidAlgorithmParameterException
- if the parameters are not appropriate
for the given Cipherjava.security.InvalidKeyException
- if the key is not appropriate for the given Cipherpublic static javax.crypto.Cipher getCipher(java.lang.String algorithm, int mode, java.security.Key key, java.security.AlgorithmParameters params, java.security.SecureRandom random) throws javax.crypto.NoSuchPaddingException, java.security.NoSuchAlgorithmException, java.security.NoSuchProviderException, java.security.InvalidKeyException, java.security.InvalidAlgorithmParameterException
This method may be called instead of Cipher.getInstance
to
create a Cipher from the IAIK provider. When using the signed unltd
iaik_jce_(full).jar
calling getCipher
allows
unlimited strength cryptography also when the default jursidiction policy
files are installed (see IAIK-JCE installation guidelines for more
information).
algorithm
- the Cipher algorithm (transformation)mode
- the Cipher mode to be used for initialization
(e.g. Cipher.ENCRYPT_MODE, Cipher.DECRYPT_MODE)key
- the key to be used for initialization; if not null
params
- any parameters to be used for initialization; if not null
random
- the SecureRandom to be used for initialization; if not null
java.security.NoSuchProviderException
- if the IAIK provider has not been installedjava.security.NoSuchAlgorithmException
- if no implementation for the requested cipher
algorithm is availablejavax.crypto.NoSuchPaddingException
- if no implementation for the given cipher
algorithm is availablejava.security.InvalidAlgorithmParameterException
- if the parameters are not appropriate
for the given Cipherjava.security.InvalidKeyException
- if the key is not appropriate for the given Cipher