本文整理了Java中org.opensaml.saml.saml2.core.Response.getSignature
方法的一些代码示例,展示了Response.getSignature
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Response.getSignature
方法的具体详情如下:
包路径:org.opensaml.saml.saml2.core.Response
类名称:Response
方法名:getSignature
暂无
代码示例来源:origin: apache/cxf
/**
* Validate the Response signature (if it exists)
*/
private void validateResponseSignature(
org.opensaml.saml.saml2.core.Response samlResponse,
Crypto sigCrypto,
CallbackHandler callbackHandler
) throws WSSecurityException {
if (!samlResponse.isSigned()) {
return;
}
// Required to make IdResolver happy in OpenSAML
Attr idAttr = samlResponse.getDOM().getAttributeNodeNS(null, "ID");
if (idAttr != null) {
samlResponse.getDOM().setIdAttributeNode(idAttr, true);
}
validateResponseSignature(
samlResponse.getSignature(), samlResponse.getDOM().getOwnerDocument(),
sigCrypto, callbackHandler
);
}
代码示例来源:origin: org.wso2.appserver/appserver-webapp-security
if (response.getSignature() == null) {
throw new SSOException("SAML 2.0 Response signing is enabled, but signature element not found " +
"in SAML 2.0 Response element");
} else {
try {
org.opensaml.xmlsec.signature.support.SignatureValidator.validate(response.getSignature(),
new X509CredentialImplementation(ssoX509Credential.getEntityCertificate()));
} catch (SignatureException e) {
代码示例来源:origin: org.apache.wss4j/wss4j-ws-security-common
private static void signXMLObject(XMLObject xmlObject) throws WSSecurityException {
if (xmlObject instanceof org.opensaml.saml.saml1.core.Response) {
org.opensaml.saml.saml1.core.Response response =
(org.opensaml.saml.saml1.core.Response)xmlObject;
// Sign any Assertions
if (response.getAssertions() != null) {
for (org.opensaml.saml.saml1.core.Assertion assertion : response.getAssertions()) {
signObject(assertion.getSignature());
}
}
signObject(response.getSignature());
} else if (xmlObject instanceof org.opensaml.saml.saml2.core.Response) {
org.opensaml.saml.saml2.core.Response response =
(org.opensaml.saml.saml2.core.Response)xmlObject;
// Sign any Assertions
if (response.getAssertions() != null) {
for (org.opensaml.saml.saml2.core.Assertion assertion : response.getAssertions()) {
signObject(assertion.getSignature());
}
}
signObject(response.getSignature());
} else if (xmlObject instanceof SignableSAMLObject) {
signObject(((SignableSAMLObject)xmlObject).getSignature());
}
}
代码示例来源:origin: org.wso2.appserver/appserver-webapp-security
if (response.getSignature() == null) {
throw new SSOException("SAML 2.0 Response signing is enabled, but signature element not found " +
"in SAML 2.0 Response element");
} else {
try {
org.opensaml.xmlsec.signature.support.SignatureValidator.validate(response.getSignature(),
new X509CredentialImplementation(ssoX509Credential.getEntityCertificate()));
} catch (SignatureException e) {
代码示例来源:origin: org.pac4j/pac4j-saml
validateSignatureIfItExists(response.getSignature(), context, engine);
内容来源于网络,如有侵权,请联系作者删除!