protected void isTrusted(String issuer) throws IssuerNotTrustedException {
try {
URL url = new URL(issuer);
String issuerDomain = url.getHost();
TrustType idpTrust = spConfiguration.getTrust();
if (idpTrust != null) {
String domainsTrusted = idpTrust.getDomains();
if (domainsTrusted.indexOf(issuerDomain) < 0)
throw new IssuerNotTrustedException(issuer);
}
} catch (Exception e) {
throw new IssuerNotTrustedException(e.getLocalizedMessage(), e);