当前位置: 首页>>代码示例>>Java>>正文


Java EncryptedAssertion.getEncryptedData方法代码示例

本文整理汇总了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));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:22,代码来源:EncryptedElementTypeEncryptedKeyResolverTest.java

示例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));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:20,代码来源:EncryptedElementTypeEncryptedKeyResolverTest.java

示例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));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:20,代码来源:EncryptedElementTypeEncryptedKeyResolverTest.java

示例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());
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:18,代码来源:EncryptedElementTypeEncryptedKeyResolverTest.java

示例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));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:22,代码来源:EncryptedElementTypeEncryptedKeyResolverTest.java

示例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));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:23,代码来源:EncryptedElementTypeEncryptedKeyResolverTest.java

示例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));
}
 
开发者ID:apigee,项目名称:java-opensaml2,代码行数:22,代码来源:EncryptedElementTypeEncryptedKeyResolverTest.java


注:本文中的org.opensaml.saml2.core.EncryptedAssertion.getEncryptedData方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。