org.opensaml.saml.saml2.core.Response.getEncryptedAssertions()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(97)

本文整理了Java中org.opensaml.saml.saml2.core.Response.getEncryptedAssertions方法的一些代码示例,展示了Response.getEncryptedAssertions的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.getEncryptedAssertions方法的具体详情如下:
包路径:org.opensaml.saml.saml2.core.Response
类名称:Response
方法名:getEncryptedAssertions

Response.getEncryptedAssertions介绍

[英]Return the list of EncryptedAssertion child elements.
[中]返回EncryptedAssertion子元素的列表。

代码示例

代码示例来源:origin: line/armeria

if (response.getEncryptedAssertions().isEmpty()) {
  assertions = response.getAssertions();
} else {
  for (final EncryptedAssertion encryptedAssertion : response.getEncryptedAssertions()) {
    builder.add(decryptAssertion(encryptedAssertion, idp.encryptionCredential()));

代码示例来源:origin: org.opensaml/opensaml-saml-impl

/** {@inheritDoc} */
protected void processChildElement(XMLObject parentSAMLObject, XMLObject childSAMLObject)
    throws UnmarshallingException {
  Response resp = (Response) parentSAMLObject;
  if (childSAMLObject instanceof Assertion) {
    resp.getAssertions().add((Assertion) childSAMLObject);
  } else if (childSAMLObject instanceof EncryptedAssertion) {
    resp.getEncryptedAssertions().add((EncryptedAssertion) childSAMLObject);
  } else {
    super.processChildElement(parentSAMLObject, childSAMLObject);
  }
}

代码示例来源:origin: org.pac4j/pac4j-saml

/**
 * Decrypt encrypted assertions and add them to the assertions list of the response.
 *
 * @param response  the response
 * @param decrypter the decrypter
 */
protected final void decryptEncryptedAssertions(final Response response, final Decrypter decrypter) {
  for (final EncryptedAssertion encryptedAssertion : response.getEncryptedAssertions()) {
    try {
      final Assertion decryptedAssertion = decrypter.decrypt(encryptedAssertion);
      response.getAssertions().add(decryptedAssertion);
    } catch (final DecryptionException e) {
      logger.error("Decryption of assertion failed, continue with the next one", e);
    }
  }
}

代码示例来源:origin: org.opensaml/opensaml-saml-impl

final Iterator<EncryptedAssertion> i = response.getEncryptedAssertions().iterator();
while (i.hasNext()) {
  log.debug("{} Decrypting EncryptedAssertion in Response", getLogPrefix());

代码示例来源:origin: org.opensaml/opensaml-saml-impl

/** {@inheritDoc} */
@Override
protected void doExecute(@Nonnull final ProfileRequestContext profileRequestContext) {
  
  final List<EncryptedAssertion> accumulator = new ArrayList<>(response.getAssertions().size());
  
  for (final Assertion assertion : response.getAssertions()) {
    try {
      if (log.isDebugEnabled()) {
        try {
          final Element dom = XMLObjectSupport.marshall(assertion);
          log.debug("{} Assertion before encryption:\n{}", getLogPrefix(),
              SerializeSupport.prettyPrintXML(dom));
        } catch (final MarshallingException e) {
          log.error("{} Unable to marshall message for logging purposes", getLogPrefix(), e);
        }
      }
      accumulator.add(getEncrypter().encrypt(assertion));
    } catch (final EncryptionException e) {
      log.warn("{} Error encrypting assertion", getLogPrefix(), e);
      ActionSupport.buildEvent(profileRequestContext, EventIds.UNABLE_TO_ENCRYPT);
      return;
    }
  }
  
  response.getEncryptedAssertions().addAll(accumulator);
  response.getAssertions().clear();
}

代码示例来源:origin: spring-projects/spring-security-saml

.collect(Collectors.toList())
  );
if (parsed.getEncryptedAssertions() != null && !parsed.getEncryptedAssertions().isEmpty()) {
  parsed
    .getEncryptedAssertions()
    .stream()
    .forEach(

代码示例来源:origin: org.apereo.cas/cas-server-support-saml-idp-web

samlResponse.getEncryptedAssertions().add(EncryptedAssertion.class.cast(finalAssertion));
} else {
  LOGGER.trace("Built assertion is not encrypted, so the response will add it to the assertions collection");

代码示例来源:origin: apache/cxf

for (org.opensaml.saml.saml2.core.EncryptedAssertion assertion : samlResponse.getEncryptedAssertions()) {

代码示例来源:origin: com.linecorp.armeria/armeria-saml

if (response.getEncryptedAssertions().isEmpty()) {
  assertions = response.getAssertions();
} else {
  for (final EncryptedAssertion encryptedAssertion : response.getEncryptedAssertions()) {
    builder.add(decryptAssertion(encryptedAssertion, idp.encryptionCredential()));

代码示例来源:origin: org.wso2.appserver/appserver-webapp-security

List<EncryptedAssertion> encryptedAssertions = saml2Response.getEncryptedAssertions();
EncryptedAssertion encryptedAssertion;
if (!((encryptedAssertions == null) || (encryptedAssertions.isEmpty()))) {

代码示例来源:origin: spring-projects/spring-security-saml

EncryptedAssertion encryptedAssertion =
  encryptAssertion(osAssertion, a.getEncryptionKey(), a.getKeyAlgorithm(), a.getDataAlgorithm());
result.getEncryptedAssertions().add(encryptedAssertion);

相关文章