public class CipherFactory extends Object
| Constructor and Description |
|---|
CipherFactory() |
| Modifier and Type | Method and Description |
|---|---|
static Cipher |
newCipher(int operationMode,
SecretKey key,
AlgorithmParameterSpec paramSpec,
String algorithm)
Factory method for creating a new
Cipher from the given parameters. |
static Cipher |
newCipher(String algorithm)
Factory method for creating a new
Cipher from the given algorithm. |
static Cipher |
newCipher(String algorithm,
String provider)
Factory method for creating a new
Cipher from the given algorithm and provider. |
public static Cipher newCipher(int operationMode, SecretKey key, AlgorithmParameterSpec paramSpec, String algorithm) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, InvalidAlgorithmParameterException
Cipher from the given parameters.operationMode - the operation modekey - the keyparamSpec - the param specalgorithm - the algorithmNoSuchAlgorithmException - is thrown if instantiation of the SecretKeyFactory object fails.NoSuchPaddingException - is thrown if instantiation of the cypher object fails.InvalidKeyException - is thrown if initialization of the cypher object fails.InvalidAlgorithmParameterException - is thrown if initialization of the cypher object fails.public static Cipher newCipher(String algorithm) throws NoSuchAlgorithmException, NoSuchPaddingException
Cipher from the given algorithm.algorithm - the algNoSuchAlgorithmException - is thrown if instantiation of the SecretKeyFactory object fails.NoSuchPaddingException - is thrown if instantiation of the cypher object fails.public static Cipher newCipher(String algorithm, String provider) throws NoSuchAlgorithmException, NoSuchProviderException, NoSuchPaddingException
Cipher from the given algorithm and provider.algorithm - the algorithmprovider - the providerNoSuchAlgorithmException - is thrown if instantiation of the SecretKeyFactory object fails.NoSuchProviderException - is thrown if the specified provider is not registered in the security provider
list.NoSuchPaddingException - is thrown if algorithm contains a padding scheme that is not available.Copyright © 2015–2016 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.