CryptProvider
contains methods for finding cryptographic objects
using a set of providers.
- Version:
- $Revision: 2745 $
- Author:
- Middleware Services
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Default size of random byte array. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addProvider
(Provider provider, String name) This will add an additional security provider.static CertificateFactory
getCertificateFactory
(String type) This creates aCertificateFactory
using the supplied type name.static Cipher
This finds aCipher
using the known providers and the supplied parameters.static KeyFactory
getKeyFactory
(String algorithm) This finds aKeyFactory
using the known providers and the supplied algorithm parameter.static KeyGenerator
getKeyGenerator
(String algorithm) This finds aKeyGenerator
using the known providers and the supplied algorithm parameter.static KeyPairGenerator
getKeyPairGenerator
(String algorithm) This finds aKeyPairGenerator
using the known providers and the supplied algorithm parameter.static KeyStore
This creates aKeyStore
using the default keystore type.static KeyStore
getKeyStore
(String type) This creates aKeyStore
using the supplied type name.static MessageDigest
getMessageDigest
(String algorithm) This creates aMessageDigest
using the supplied algorithm name.static SecretKeyFactory
getSecretKeyFactory
(String algorithm) This finds aSecretKeyFactory
using the known providers and the supplied algorithm parameter.static Signature
getSignature
(String digestAlgorithm, String algorithm, String padding) This finds aSignature
using the known providers and the supplied parameters.
-
Field Details
-
RANDOM_BYTE_ARRAY_SIZE
public static final int RANDOM_BYTE_ARRAY_SIZEDefault size of random byte array.- See Also:
-
-
Method Details
-
addProvider
This will add an additional security provider.
- Parameters:
provider
-DatagramsDestination
name
-String
-
getCipher
This finds a
Cipher
using the known providers and the supplied parameters.- Parameters:
algorithm
-String
namemode
-String
namepadding
-String
name- Returns:
Cipher
- Throws:
CryptException
- if the algorithm is not available from any provider or if the provider is not available in the environment
-
getSecretKeyFactory
This finds a
SecretKeyFactory
using the known providers and the supplied algorithm parameter.- Parameters:
algorithm
-String
name- Returns:
SecretKeyFactory
- Throws:
CryptException
- if the algorithm is not available from any provider or if the provider is not available in the environment
-
getKeyFactory
This finds a
KeyFactory
using the known providers and the supplied algorithm parameter.- Parameters:
algorithm
-String
name- Returns:
KeyFactory
- Throws:
CryptException
- if the algorithm is not available from any provider or if the provider is not available in the environment
-
getKeyGenerator
This finds a
KeyGenerator
using the known providers and the supplied algorithm parameter.- Parameters:
algorithm
-String
name- Returns:
KeyGenerator
- Throws:
CryptException
- if the algorithm is not available from any provider or if the provider is not available in the environment
-
getKeyPairGenerator
This finds a
KeyPairGenerator
using the known providers and the supplied algorithm parameter.- Parameters:
algorithm
-String
name- Returns:
KeyPairGenerator
- Throws:
CryptException
- if the algorithm is not available from any provider or if the provider is not available in the environment
-
getSignature
public static Signature getSignature(String digestAlgorithm, String algorithm, String padding) throws CryptException This finds a
Signature
using the known providers and the supplied parameters.- Parameters:
digestAlgorithm
-String
namealgorithm
-String
namepadding
-String
name- Returns:
Signature
- Throws:
CryptException
- if the algorithm is not available from any provider or if the provider is not available in the environment
-
getMessageDigest
This creates a
MessageDigest
using the supplied algorithm name.- Parameters:
algorithm
-String
name- Returns:
MessageDigest
- Throws:
CryptException
- if the algorithm is not available from any provider or the provider is not available in the environment
-
getKeyStore
This creates a
KeyStore
using the supplied type name.- Parameters:
type
-String
- Returns:
KeyStore
- Throws:
CryptException
- if the type is not available from any provider or the provider is not available in the environment
-
getKeyStore
This creates a
KeyStore
using the default keystore type.- Returns:
KeyStore
- Throws:
CryptException
- if the default type is not available from any provider or the provider is not available in the environment
-
getCertificateFactory
This creates a
CertificateFactory
using the supplied type name.- Parameters:
type
-String
- Returns:
CertificateFactory
- Throws:
CryptException
- if the type is not available from any provider or the provider is not available in the environment
-