final PolicyAssertion serviceProvider = serviceProviders.next();
endpointUri = serviceProvider.getAttributeValue(Q_EP);
if (endpointUri == null){
endpointUri = serviceProvider.getAttributeValue(new QName("", END_POINT.toLowerCase()));
}
final DefaultTrustSPMetadata data = new DefaultTrustSPMetadata(endpointUri);
final Iterator<PolicyAssertion> spConfig = serviceProvider.getNestedAssertionsIterator();
while(spConfig.hasNext()){
final PolicyAssertion policy = spConfig.next();
if(ALIAS.equals(policy.getName().getLocalPart())){
data.setCertAlias(policy.getValue());
}else if (TOKEN_TYPE.equals(policy.getName().getLocalPart())){
data.setTokenType(policy.getValue());
}else if (KEY_TYPE.equals(policy.getName().getLocalPart())){
data.setKeyType(policy.getValue());
}
}
config.addTrustSPMetadata(data, endpointUri);
}