public class SimpleEncryptionTest
extends org.opensaml.core.xml.XMLObjectBaseTestCase
| Modifier and Type | Field and Description |
|---|---|
private String |
algoURI |
private DataEncryptionParameters |
encParams |
private Encrypter |
encrypter |
private String |
expectedKEKKeyNameAES |
private String |
expectedKEKKeyNameRSA |
private String |
expectedKeyName |
private String |
expectedRecipientAES |
private String |
expectedRecipientRSA |
private org.opensaml.xmlsec.signature.KeyInfo |
kekKeyInfoAES |
private org.opensaml.xmlsec.signature.KeyInfo |
kekKeyInfoRSA |
private KeyEncryptionParameters |
kekParamsAES |
private List<KeyEncryptionParameters> |
kekParamsList |
private KeyEncryptionParameters |
kekParamsRSA |
private String |
kekURIAES |
private String |
kekURIRSA |
private org.opensaml.xmlsec.signature.KeyInfo |
keyInfo |
private org.opensaml.security.SecurityProviderTestSupport |
providerSupport |
private String |
targetFile |
| Constructor and Description |
|---|
SimpleEncryptionTest()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
private void |
checkKEKAES(org.opensaml.xmlsec.encryption.EncryptedKey encKey,
boolean hasKeyInfo)
Helper method to test AES KEK.
|
private void |
checkKEKRSA(org.opensaml.xmlsec.encryption.EncryptedKey encKey,
boolean hasKeyInfo)
Helper method to test RSA KEK.
|
private String |
getDigestMethod(org.opensaml.xmlsec.encryption.EncryptedKey encryptedKey) |
private String |
getMGF(org.opensaml.xmlsec.encryption.EncryptedKey encryptedKey) |
private String |
getOAEPParams(org.opensaml.xmlsec.encryption.EncryptedKey encryptedKey) |
protected void |
setUp() |
void |
testAutoKeyGen()
Test basic encryption with auto-generated symmetric key.
|
void |
testAutoKeyGenNoKEK()
Test failure with auto-generated symmetric key and no KEK(s).
|
void |
testEncryptContentMultipleKEK()
Test basic encryption with symmetric key, one KEK.
|
void |
testEncryptContentSingleKEK()
Test basic content encryption with symmetric key, one KEK.
|
void |
testEncryptContentWithKeyNameNoKEK()
Test basic content encryption with symmetric key, no key wrap,
set key name in passed KeyInfo object.
|
void |
testEncryptDataBadKEKDSA()
Test proper error handling of attempt to encrypt with a DSA key.
|
void |
testEncryptDataMultipleKEK()
Test basic data encryption with symmetric key, one KEK.
|
void |
testEncryptDataSingleKEK()
Test data basic encryption with symmetric key, one KEK.
|
void |
testEncryptDataWithKeyNameNoKEK()
Test data basic encryption with symmetric key, no key wrap,
set key name in passed KeyInfo object.
|
void |
testEncryptKeyDigestMethodsRSAOAEP()
Test code for the Apache XML-Security issue workaround that requires we
expliclty express SHA-1 DigestMethod on EncryptionMethod,
only when key transport algorithm is RSA-OAEP.
|
void |
testEncryptKeyDigestMethodsRSAv15()
Test code for the Apache XML-Security issue workaround that requires we
expliclty express SHA-1 DigestMethod on EncryptionMethod,
only when key transport algorithm is RSA-OAEP.
|
void |
testEncryptKeyMultipleKEK()
Test basic encryption of a symmetric key into an EncryptedKey,
set key encrypting key name in passed KeyInfo object.
|
void |
testEncryptKeySingleKEK()
Test basic encryption of a symmetric key into an EncryptedKey,
set key encrypting key name in passed KeyInfo object.
|
void |
testRSAOAEPParameters()
Test encryption of a symmetric key into an EncryptedKey,
using various RSAOAEPParameters options.
|
assertXMLEquals, assertXMLEquals, buildXMLObject, fetchDuration, getBuilder, getMarshaller, getMarshaller, getUnmarshaller, getUnmarshaller, getUnmarshaller, initXMLObjectSupport, parseXMLDocument, printXML, printXML, unmarshallElementprivate Encrypter encrypter
private DataEncryptionParameters encParams
private String algoURI
private List<KeyEncryptionParameters> kekParamsList
private KeyEncryptionParameters kekParamsAES
private String kekURIAES
private KeyEncryptionParameters kekParamsRSA
private String kekURIRSA
private org.opensaml.xmlsec.signature.KeyInfo keyInfo
private org.opensaml.xmlsec.signature.KeyInfo kekKeyInfoAES
private org.opensaml.xmlsec.signature.KeyInfo kekKeyInfoRSA
private String expectedKeyName
private String expectedKEKKeyNameAES
private String expectedKEKKeyNameRSA
private String expectedRecipientRSA
private String expectedRecipientAES
private String targetFile
private org.opensaml.security.SecurityProviderTestSupport providerSupport
public void testEncryptDataWithKeyNameNoKEK()
public void testEncryptDataSingleKEK()
public void testEncryptDataMultipleKEK()
public void testEncryptContentWithKeyNameNoKEK()
public void testEncryptContentSingleKEK()
public void testEncryptContentMultipleKEK()
public void testEncryptKeySingleKEK()
throws NoSuchAlgorithmException,
NoSuchProviderException,
net.shibboleth.utilities.java.support.xml.XMLParserException,
KeyException
NoSuchProviderException - bad JCA providerNoSuchAlgorithmException - bad JCA algorithmnet.shibboleth.utilities.java.support.xml.XMLParserException - error creating new Document from poolKeyExceptionpublic void testEncryptKeyMultipleKEK()
throws NoSuchAlgorithmException,
NoSuchProviderException,
net.shibboleth.utilities.java.support.xml.XMLParserException,
KeyException
NoSuchProviderException - bad JCA providerNoSuchAlgorithmException - bad JCA algorithmnet.shibboleth.utilities.java.support.xml.XMLParserException - error creating new Document from poolKeyExceptionpublic void testAutoKeyGen()
public void testAutoKeyGenNoKEK()
public void testEncryptKeyDigestMethodsRSAOAEP()
throws NoSuchAlgorithmException,
NoSuchProviderException,
net.shibboleth.utilities.java.support.xml.XMLParserException,
KeyException
NoSuchProviderException - bad JCA providerNoSuchAlgorithmException - bad JCA algorithmnet.shibboleth.utilities.java.support.xml.XMLParserException - error creating new Document from poolKeyExceptionpublic void testEncryptKeyDigestMethodsRSAv15()
throws NoSuchAlgorithmException,
NoSuchProviderException,
net.shibboleth.utilities.java.support.xml.XMLParserException,
KeyException
NoSuchProviderException - bad JCA providerNoSuchAlgorithmException - bad JCA algorithmnet.shibboleth.utilities.java.support.xml.XMLParserException - error creating new Document from poolKeyExceptionpublic void testEncryptDataBadKEKDSA()
throws NoSuchAlgorithmException,
NoSuchProviderException
public void testRSAOAEPParameters()
throws NoSuchAlgorithmException,
NoSuchProviderException,
net.shibboleth.utilities.java.support.xml.XMLParserException,
KeyException,
EncryptionException
NoSuchProviderException - bad JCA providerNoSuchAlgorithmException - bad JCA algorithmnet.shibboleth.utilities.java.support.xml.XMLParserException - error creating new Document from poolKeyExceptionEncryptionExceptionprivate void checkKEKAES(org.opensaml.xmlsec.encryption.EncryptedKey encKey,
boolean hasKeyInfo)
encKey - EncryptedKey to testhasKeyInfo - flag indicating expectation of KeyInfo presenceprivate void checkKEKRSA(org.opensaml.xmlsec.encryption.EncryptedKey encKey,
boolean hasKeyInfo)
encKey - EncryptedKey to testhasKeyInfo - flag indicating expectation of KeyInfo presenceprivate String getDigestMethod(org.opensaml.xmlsec.encryption.EncryptedKey encryptedKey)
private String getMGF(org.opensaml.xmlsec.encryption.EncryptedKey encryptedKey)
private String getOAEPParams(org.opensaml.xmlsec.encryption.EncryptedKey encryptedKey)
Copyright © 1999–2015. All rights reserved.