throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
"cannot get certificate or key"
);
}
SAMLKeyInfo samlKeyInfo =
SAMLUtil.getCredentialFromKeyInfo(
keyInfo.getDOM(), new WSSSAMLKeyInfoProcessor(data, docInfo), data.getSigVerCrypto()
);
if (algorithmSuite != null) {
AlgorithmSuiteValidator algorithmSuiteValidator = new
AlgorithmSuiteValidator(algorithmSuite);
PublicKey key = null;
if (samlKeyInfo.getCerts() != null && samlKeyInfo.getCerts()[0] != null) {
key = samlKeyInfo.getCerts()[0].getPublicKey();
} else if (samlKeyInfo.getPublicKey() != null) {
key = samlKeyInfo.getPublicKey();
} else {
throw new WSSecurityException(
WSSecurityException.ErrorCode.FAILURE, "invalidSAMLsecurity",
"cannot get certificate or key");
}