|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.opensaml.xml.security.SecurityTestHelper
public final class SecurityTestHelper
Constructor Summary | |
---|---|
private |
SecurityTestHelper()
Deprecated. Constructor. |
Method Summary | |
---|---|
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private SecurityTestHelper()
Method Detail |
---|
public static X509Certificate buildJavaX509Cert(String base64Cert) throws CertificateException
base64Cert
- base64-encoded certificate
CertificateException
- thrown if there is an error constructing certificatepublic static X509CRL buildJavaX509CRL(String base64CRL) throws CertificateException, CRLException
base64CRL
- base64-encoded CRL
CertificateException
- thrown if there is an error constructing certificate
CRLException
- thrown if there is an error constructing CRLpublic static DSAPublicKey buildJavaDSAPublicKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded DSA public key
KeyException
- thrown if there is an error constructing keypublic static RSAPublicKey buildJavaRSAPublicKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded RSA public key
KeyException
- thrown if there is an error constructing keypublic static RSAPrivateKey buildJavaRSAPrivateKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded RSA private key
KeyException
- thrown if there is an error constructing keypublic static DSAPrivateKey buildJavaDSAPrivateKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded DSA private key
KeyException
- thrown if there is an error constructing keypublic static PrivateKey buildJavaPrivateKey(String base64EncodedKey) throws KeyException
base64EncodedKey
- base64-encoded private key
KeyException
- 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 supported
PublicKey
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 URI
NoSuchProviderException
- provider not found
NoSuchAlgorithmException
- algorithm not foundpublic static KeyPair generateKeyPairFromURI(String algoURI, int keyLength) throws NoSuchAlgorithmException, NoSuchProviderException
algoURI
- The XML Encryption algorithm URIkeyLength
- the length of key to generate
NoSuchProviderException
- provider not found
NoSuchAlgorithmException
- algorithm not foundpublic static SecretKey generateKey(String algo, int keyLength, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
algo
- key algorithmkeyLength
- key lengthprovider
- JCA provider
NoSuchAlgorithmException
- algorithm not found
NoSuchProviderException
- provider not foundpublic static KeyPair generateKeyPair(String algo, int keyLength, String provider) throws NoSuchAlgorithmException, NoSuchProviderException
algo
- key algorithmkeyLength
- key lengthprovider
- JCA provider
NoSuchAlgorithmException
- algorithm not found
NoSuchProviderException
- provider not foundpublic static Credential generateKeyAndCredential(String algorithmURI) throws NoSuchAlgorithmException, NoSuchProviderException
algorithmURI
- The XML Encryption algorithm URI
NoSuchAlgorithmException
- algorithm not found
NoSuchProviderException
- 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 well
NoSuchAlgorithmException
- algorithm not found
NoSuchProviderException
- provider not foundpublic static KeyInfoCredentialResolver buildBasicInlineKeyInfoResolver()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |