本文整理汇总了Java中org.opensaml.saml2.core.EncryptedAssertion.getEncryptedData方法的典型用法代码示例。如果您正苦于以下问题:Java EncryptedAssertion.getEncryptedData方法的具体用法?Java EncryptedAssertion.getEncryptedData怎么用?Java EncryptedAssertion.getEncryptedData使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.opensaml.saml2.core.EncryptedAssertion
的用法示例。
在下文中一共展示了EncryptedAssertion.getEncryptedData方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testSingleEKMultiRecipientWithImplicitMatch
import org.opensaml.saml2.core.EncryptedAssertion; //导入方法依赖的package包/类
/** Multiple recipients specified to resolver, one EncryptedKey in instance with no recipient. */
public void testSingleEKMultiRecipientWithImplicitMatch() {
String filename =
"/data/org/opensaml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolverSingleNoRecipient.xml";
EncryptedAssertion encAssertion = (EncryptedAssertion) unmarshallElement(filename);
assertNotNull(encAssertion.getEncryptedData());
EncryptedData encData = encAssertion.getEncryptedData();
List<EncryptedKey> allKeys = encAssertion.getEncryptedKeys();
assertFalse(allKeys.isEmpty());
resolver.getRecipients().add("foo");
resolver.getRecipients().add("bar");
resolver.getRecipients().add("baz");
List<EncryptedKey> resolved = generateList(encData, resolver);
assertEquals("Incorrect number of resolved EncryptedKeys found", 1, resolved.size());
assertTrue("Unexpected EncryptedKey instance found", resolved.get(0) == allKeys.get(0));
}
示例2: testSingleEKOneRecipientWithMatch
import org.opensaml.saml2.core.EncryptedAssertion; //导入方法依赖的package包/类
/** One recipient specified to resolver, one matching EncryptedKey in instance. */
public void testSingleEKOneRecipientWithMatch() {
String filename =
"/data/org/opensaml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolverSingleWithRecipient.xml";
EncryptedAssertion encAssertion = (EncryptedAssertion) unmarshallElement(filename);
assertNotNull(encAssertion.getEncryptedData());
EncryptedData encData = encAssertion.getEncryptedData();
List<EncryptedKey> allKeys = encAssertion.getEncryptedKeys();
assertFalse(allKeys.isEmpty());
resolver.getRecipients().add("foo");
List<EncryptedKey> resolved = generateList(encData, resolver);
assertEquals("Incorrect number of resolved EncryptedKeys found", 1, resolved.size());
assertTrue("Unexpected EncryptedKey instance found", resolved.get(0) == allKeys.get(0));
}
示例3: testSingleEKNoRecipients
import org.opensaml.saml2.core.EncryptedAssertion; //导入方法依赖的package包/类
/** No recipients specified to resolver, one EncryptedKey in instance. */
public void testSingleEKNoRecipients() {
String filename =
"/data/org/opensaml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolverSingleNoRecipient.xml";
EncryptedAssertion encAssertion = (EncryptedAssertion) unmarshallElement(filename);
assertNotNull(encAssertion.getEncryptedData());
EncryptedData encData = encAssertion.getEncryptedData();
List<EncryptedKey> allKeys = encAssertion.getEncryptedKeys();
assertFalse(allKeys.isEmpty());
resolver.getRecipients().clear();
List<EncryptedKey> resolved = generateList(encData, resolver);
assertEquals("Incorrect number of resolved EncryptedKeys found", 1, resolved.size());
assertTrue("Unexpected EncryptedKey instance found", resolved.get(0) == allKeys.get(0));
}
示例4: testSingleEKOneRecipientNoMatch
import org.opensaml.saml2.core.EncryptedAssertion; //导入方法依赖的package包/类
/** One recipient specified to resolver, zero matching EncryptedKey in instance. */
public void testSingleEKOneRecipientNoMatch() {
String filename =
"/data/org/opensaml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolverSingleWithRecipient.xml";
EncryptedAssertion encAssertion = (EncryptedAssertion) unmarshallElement(filename);
assertNotNull(encAssertion.getEncryptedData());
EncryptedData encData = encAssertion.getEncryptedData();
List<EncryptedKey> allKeys = encAssertion.getEncryptedKeys();
assertFalse(allKeys.isEmpty());
resolver.getRecipients().add("bar");
List<EncryptedKey> resolved = generateList(encData, resolver);
assertEquals("Incorrect number of resolved EncryptedKeys found", 0, resolved.size());
}
示例5: testMultiEKNoRecipients
import org.opensaml.saml2.core.EncryptedAssertion; //导入方法依赖的package包/类
/** No recipients specified to resolver. */
public void testMultiEKNoRecipients() {
String filename = "/data/org/opensaml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolverMultiple.xml";
EncryptedAssertion encAssertion = (EncryptedAssertion) unmarshallElement(filename);
assertNotNull(encAssertion.getEncryptedData());
EncryptedData encData = encAssertion.getEncryptedData();
List<EncryptedKey> allKeys = encAssertion.getEncryptedKeys();
assertFalse(allKeys.isEmpty());
resolver.getRecipients().clear();
List<EncryptedKey> resolved = generateList(encData, resolver);
assertEquals("Incorrect number of resolved EncryptedKeys found", 4, resolved.size());
assertTrue("Unexpected EncryptedKey instance found", resolved.get(0) == allKeys.get(0));
assertTrue("Unexpected EncryptedKey instance found", resolved.get(1) == allKeys.get(1));
assertTrue("Unexpected EncryptedKey instance found", resolved.get(2) == allKeys.get(2));
assertTrue("Unexpected EncryptedKey instance found", resolved.get(3) == allKeys.get(3));
}
示例6: testMultiEKOneRecipientWithMatch
import org.opensaml.saml2.core.EncryptedAssertion; //导入方法依赖的package包/类
/** One recipient specified to resolver, one matching & and one recipient-less
* EncryptedKey in instance. */
public void testMultiEKOneRecipientWithMatch() {
String filename = "/data/org/opensaml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolverMultiple.xml";
EncryptedAssertion encAssertion = (EncryptedAssertion) unmarshallElement(filename);
assertNotNull(encAssertion.getEncryptedData());
EncryptedData encData = encAssertion.getEncryptedData();
List<EncryptedKey> allKeys = encAssertion.getEncryptedKeys();
assertFalse(allKeys.isEmpty());
resolver.getRecipients().clear();
resolver.getRecipients().add("foo");
List<EncryptedKey> resolved = generateList(encData, resolver);
assertEquals("Incorrect number of resolved EncryptedKeys found", 2, resolved.size());
assertTrue("Unexpected EncryptedKey instance found", resolved.get(0) == allKeys.get(0));
assertTrue("Unexpected EncryptedKey instance found", resolved.get(1) == allKeys.get(2));
}
示例7: testMultiEKOneRecipientWithMatches
import org.opensaml.saml2.core.EncryptedAssertion; //导入方法依赖的package包/类
/** Multi recipient specified to resolver, several matching EncryptedKey in instance. */
public void testMultiEKOneRecipientWithMatches() {
String filename = "/data/org/opensaml/saml2/encryption/EncryptedElementTypeEncryptedKeyResolverMultiple.xml";
EncryptedAssertion encAssertion = (EncryptedAssertion) unmarshallElement(filename);
assertNotNull(encAssertion.getEncryptedData());
EncryptedData encData = encAssertion.getEncryptedData();
List<EncryptedKey> allKeys = encAssertion.getEncryptedKeys();
assertFalse(allKeys.isEmpty());
resolver.getRecipients().add("foo");
resolver.getRecipients().add("baz");
List<EncryptedKey> resolved = generateList(encData, resolver);
assertEquals("Incorrect number of resolved EncryptedKeys found", 3, resolved.size());
assertTrue("Unexpected EncryptedKey instance found", resolved.get(0) == allKeys.get(0));
assertTrue("Unexpected EncryptedKey instance found", resolved.get(1) == allKeys.get(2));
assertTrue("Unexpected EncryptedKey instance found", resolved.get(2) == allKeys.get(3));
}