* @throws IdentityException
*/
public void removeUserTrustedRelyingParty(String user, String hostName)
throws IdentityProviderException, IdentityException, CarbonException {
String storeFilePath = null;
KeyStoreAdmin keyAdmin = null;
UserTrustedRPDO rpdo = null;
storeFilePath = IdentityUtil
.getProperty(IdentityConstants.ServerConfig.USER_TRUSTED_RP_STORE_LOCATION);
rpdo = new UserTrustedRPDO();
rpdo.setHostName(hostName);
rpdo.setUserId(user);
dbMan.removeUserTrustedRelyingParty(getRegsitry(), rpdo);
try {
keyAdmin = new KeyStoreAdmin(IdentityTenantUtil.getRegistryService().getGovernanceSystemRegistry());
keyAdmin.removeCertFromStore(hostName, new File(storeFilePath).getName());
} catch (SecurityConfigException e) {
throw new IdentityProviderException(e.getMessage(), e);
} catch (RegistryException e) {
throw new IdentityProviderException(e.getMessage(), e);
}