public final class SecurityTestHelper extends Object
Modifier and Type | Method and Description |
---|---|
static KeyInfoCredentialResolver |
buildBasicInlineKeyInfoResolver()
Deprecated.
Get a basic KeyInfo credential resolver which can process standard inline
data - RSAKeyValue, DSAKeyValue, X509Data.
|
static DSAPrivateKey |
buildJavaDSAPrivateKey(String base64EncodedKey)
Deprecated.
Build Java DSA private key from base64 encoding.
|
static DSAPublicKey |
buildJavaDSAPublicKey(String base64EncodedKey)
Deprecated.
Build Java DSA public key from base64 encoding.
|
static PrivateKey |
buildJavaPrivateKey(String base64EncodedKey)
Deprecated.
Build Java private key from base64 encoding. The key should have no password.
|
static RSAPrivateKey |
buildJavaRSAPrivateKey(String base64EncodedKey)
Deprecated.
Build Java RSA private key from base64 encoding.
|
static RSAPublicKey |
buildJavaRSAPublicKey(String base64EncodedKey)
Deprecated.
Build Java RSA public key from base64 encoding.
|
static X509Certificate |
buildJavaX509Cert(String base64Cert)
Deprecated.
Build Java certificate from base64 encoding.
|
static X509CRL |
buildJavaX509CRL(String base64CRL)
Deprecated.
Build Java CRL from base64 encoding.
|
static PublicKey |
buildKey(KeySpec keySpec,
String keyAlgorithm)
Deprecated.
Generates a public key from the given key spec.
|
static SecretKey |
generateKey(String algo,
int keyLength,
String provider)
Deprecated.
Generate a random symmetric key.
|
static Credential |
generateKeyAndCredential(String algorithmURI)
Deprecated.
Generate a random symmetric key and return in a BasicCredential.
|
static SecretKey |
generateKeyFromURI(String algoURI)
Deprecated.
Randomly generates a Java JCE symmetric Key object from the specified XML Encryption algorithm URI.
|
static KeyPair |
generateKeyPair(String algo,
int keyLength,
String provider)
Deprecated.
Generate a random asymmetric key pair.
|
static Credential |
generateKeyPairAndCredential(String algorithmURI,
int keyLength,
boolean includePrivate)
Deprecated.
Generate a random asymmetric key pair and return in a BasicCredential.
|
static KeyPair |
generateKeyPairFromURI(String algoURI,
int keyLength)
Deprecated.
Randomly generates a Java JCE KeyPair object from the specified XML Encryption algorithm URI.
|
public static X509Certificate buildJavaX509Cert(String base64Cert) throws CertificateException
base64Cert
- base64-encoded certificateCertificateException
- thrown if there is an error constructing certificatepublic static X509CRL buildJavaX509CRL(String base64CRL) throws CertificateException, CRLException
base64CRL
- base64-encoded CRLCertificateException
- thrown if there is an error constructing certificateCRLException
- thrown if there is an error constructing CRLpublic static DSAPublicKey buildJavaDSAPublicKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded DSA public keyKeyException
- thrown if there is an error constructing keypublic static RSAPublicKey buildJavaRSAPublicKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded RSA public keyKeyException
- thrown if there is an error constructing keypublic static RSAPrivateKey buildJavaRSAPrivateKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded RSA private keyKeyException
- thrown if there is an error constructing keypublic static DSAPrivateKey buildJavaDSAPrivateKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded DSA private keyKeyException
- thrown if there is an error constructing keypublic static PrivateKey buildJavaPrivateKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded private keyKeyException
- thrown if there is an error constructing keypublic static PublicKey buildKey(KeySpec keySpec, String keyAlgorithm) throws KeyException
keySpec
- KeySpec
specification for the keykeyAlgorithm
- key generation algorithm, only DSA and RSA supportedPublicKey
KeyException
- thrown if the key algorithm is not supported by the JCE or the key spec does not
contain valid informationpublic static SecretKey generateKeyFromURI(String algoURI) throws NoSuchAlgorithmException, NoSuchProviderException
algoURI
- The XML Encryption algorithm URINoSuchProviderException
- provider not foundNoSuchAlgorithmException
- algorithm not foundpublic static KeyPair generateKeyPairFromURI(String algoURI, int keyLength) throws NoSuchAlgorithmException, NoSuchProviderException
algoURI
- The XML Encryption algorithm URIkeyLength
- the length of key to generateNoSuchProviderException
- provider not foundNoSuchAlgorithmException
- algorithm not foundpublic static SecretKey generateKey(String algo, int keyLength, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
algo
- key algorithmkeyLength
- key lengthprovider
- JCA providerNoSuchAlgorithmException
- algorithm not foundNoSuchProviderException
- provider not foundpublic static KeyPair generateKeyPair(String algo, int keyLength, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
algo
- key algorithmkeyLength
- key lengthprovider
- JCA providerNoSuchAlgorithmException
- algorithm not foundNoSuchProviderException
- provider not foundpublic static Credential generateKeyAndCredential(String algorithmURI) throws NoSuchAlgorithmException, NoSuchProviderException
algorithmURI
- The XML Encryption algorithm URINoSuchAlgorithmException
- algorithm not foundNoSuchProviderException
- provider not foundpublic static Credential generateKeyPairAndCredential(String algorithmURI, int keyLength, boolean includePrivate) throws NoSuchAlgorithmException, NoSuchProviderException
algorithmURI
- The XML Encryption algorithm URIkeyLength
- key lengthincludePrivate
- if true, the private key will be included as wellNoSuchAlgorithmException
- algorithm not foundNoSuchProviderException
- provider not foundpublic static KeyInfoCredentialResolver buildBasicInlineKeyInfoResolver()
Copyright © 2018 JBoss by Red Hat. All rights reserved.