Package org.wso2.carbon.identity.base

Examples of org.wso2.carbon.identity.base.IdentityException


    try {
      KeyStoreAdmin keyAdmin = new KeyStoreAdmin(IdentityTenantUtil.getRegistry(null, null));
      KeyStoreData[] keystores = keyAdmin.getKeyStores();
      if (keystores.length == 0 || keystores.length > 1) {
        throw new IdentityException("There should be only one keystore");
      }
      KeyStoreManager keyMan = KeyStoreManager.getInstance(null);
      KeyStore store = keyMan.getKeyStore(keystores[0].getKeyStoreName());
      Certificate[] certChain = store.getCertificateChain(alias);
      X509Certificate[] certs = new X509Certificate[certChain.length];
      for (int i = 0; i < certs.length; i++) {
        certs[i] = (X509Certificate) certChain[i];
      }
      return certs;
    } catch (Exception e) {
      log.error("Error while retreiving certificate for alias", e);
      throw new IdentityException("Error while retreiving certificate for alias", e);
    }

  }
View Full Code Here


        cert = (X509Certificate) store.getCertificate(keyalias);
      }

    } catch (Exception e) {
      log.error("Error while retreiving certificate to include in Mex for service ", e);
      throw new IdentityException(
          "Error while retreiving certificate to include in Mex for service ", e);
    }

    return cert;
  }
View Full Code Here

    try {
      KeyStoreAdmin keyAdmin = new KeyStoreAdmin(IdentityTenantUtil.getRegistry(null, null));
      return keyAdmin.getPrivateKey(alias);
    } catch (Exception e) {
      log.error("Error while retreiving private key for alias ", e);
      throw new IdentityException("Error while retreiving private key for alias ", e);
    }
  }
View Full Code Here

      KeyStoreManager keyMan = KeyStoreManager.getInstance(null);
      KeyStore store = keyMan.getKeyStore(keyStoreName);
      return (X509Certificate) store.getCertificate(alias);
    } catch (Exception e) {
      log.error("Error while retreiving certificate for alias ", e);
      throw new IdentityException("Error while retreiving certificate for alias ", e);
    }
  }
View Full Code Here

                    registry.rollbackTransaction();
                }
                if (e instanceof RegistryException) {
                    throw (RegistryException)e;
                } else {
                    throw new IdentityException("Error occured while creating an OpenID user relying party", e);
                }
            }


        } catch (RegistryException e) {
            log.error("Error occured while creating an OpenID user relying party", e);
            throw new IdentityException(
                    "Error occured while creating an OpenID user relying party", e);
        }
    }
View Full Code Here

            resource.addProperty(IdentityRegistryResources.PROP_USER_ID, oprp.getUserName());
            registry.put(path, resource);

        } catch (RegistryException e) {
            log.error("Error occured while updating an OpenID user relying party", e);
            throw new IdentityException(
                    "Error occured while updating an OpenID user relying party", e);
        }
    }
View Full Code Here

                    registry.rollbackTransaction();
                }
                if (e instanceof RegistryException) {
                    throw (RegistryException)e;
                } else {
                    throw new IdentityException("Error occured while deleting an OpenID user relying party", e);
                }
            }

        } catch (RegistryException e) {
            log.error("Error occured while deleting an OpenID user relying party", e);
            throw new IdentityException(
                    "Error occured while deleting an OpenID user relying party", e);
        }
    }
View Full Code Here

                    }
                }
            }
        } catch (RegistryException e) {
            log.error("Error occured while retreiving OpenID user relying party", e);
            throw new IdentityException("Error occured while retreiving OpenID user relying party",
                    e);
        }
        return rp;
    }
View Full Code Here

                }
            }

        } catch (RegistryException e) {
            log.error("Error occured while retreiving all OP RPs", e);
            throw new IdentityException("Error occured while retreiving all OP RPs", e);
        }

        return rpdos.toArray(new OpenIDUserRPDO[rpdos.size()]);
    }
View Full Code Here

                    lst.add(rp);
                }
            }
        } catch (RegistryException e) {
            log.error("Error occured while retreiving OpenID user relying parties", e);
            throw new IdentityException(
                    "Error occured while retreiving OpenID user relying parties", e);
        }
        return lst.toArray(new OpenIDUserRPDO[lst.size()]);
    }
View Full Code Here

TOP

Related Classes of org.wso2.carbon.identity.base.IdentityException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.