本文整理汇总了Java中org.opensaml.saml.security.impl.SAMLSignatureProfileValidator类的典型用法代码示例。如果您正苦于以下问题:Java SAMLSignatureProfileValidator类的具体用法?Java SAMLSignatureProfileValidator怎么用?Java SAMLSignatureProfileValidator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SAMLSignatureProfileValidator类属于org.opensaml.saml.security.impl包,在下文中一共展示了SAMLSignatureProfileValidator类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: validateSignatureOnProfileRequest
import org.opensaml.saml.security.impl.SAMLSignatureProfileValidator; //导入依赖的package包/类
private void validateSignatureOnProfileRequest(final RequestAbstractType profileRequest,
final Signature signature,
final RoleDescriptorResolver roleDescriptorResolver) throws Exception {
final SAMLSignatureProfileValidator validator = new SAMLSignatureProfileValidator();
LOGGER.debug("Validating profile signature for [{}] via [{}]...", profileRequest.getIssuer(),
validator.getClass().getSimpleName());
validator.validate(signature);
LOGGER.debug("Successfully validated profile signature for [{}].", profileRequest.getIssuer());
final Credential credential = getSigningCredential(roleDescriptorResolver, profileRequest);
if (credential == null) {
throw new SamlException("Signing credential for validation could not be resolved");
}
LOGGER.debug("Validating signature using credentials for [{}]", credential.getEntityId());
SignatureValidator.validate(signature, credential);
LOGGER.info("Successfully validated the request signature.");
}
开发者ID:mrluo735,项目名称:cas-5.1.0,代码行数:19,代码来源:SamlObjectSignatureValidator.java
示例2: verifyAssertionSignature
import org.opensaml.saml.security.impl.SAMLSignatureProfileValidator; //导入依赖的package包/类
private void verifyAssertionSignature(Assertion assertion) {
if (!assertion.isSigned()) {
throw new RuntimeException("The SAML Assertion was not signed");
}
try {
SAMLSignatureProfileValidator profileValidator = new SAMLSignatureProfileValidator();
profileValidator.validate(assertion.getSignature());
SignatureValidator.validate(assertion.getSignature(), IDPCredentials.getCredential());
logger.info("SAML Assertion signature verified");
} catch (SignatureException e) {
e.printStackTrace();
}
}
开发者ID:sunrongxin7666,项目名称:OpenSAML-ref-project-demo-v3,代码行数:19,代码来源:ConsumerServlet.java
注:本文中的org.opensaml.saml.security.impl.SAMLSignatureProfileValidator类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论