Examples of HardTokenIssuer


Examples of org.ejbca.core.model.hardtoken.HardTokenIssuer

  /**
   * Method that returns the hard token issuer data and updates it if nessesary.
   */
  @Transient
  public HardTokenIssuer getHardTokenIssuer(){
    HardTokenIssuer returnval = new HardTokenIssuer();
    returnval.loadData(getData());
    return returnval;
  }
View Full Code Here

Examples of org.ejbca.core.model.hardtoken.HardTokenIssuer

        }
        boolean returnval = false;
        org.ejbca.core.ejb.hardtoken.HardTokenIssuerData htih = org.ejbca.core.ejb.hardtoken.HardTokenIssuerData.findByAlias(entityManager, oldalias);
        if (htih != null) {
            try {
              HardTokenIssuer issuerdata = (HardTokenIssuer) htih.getHardTokenIssuer().clone();
                returnval = addHardTokenIssuer(admin, newalias, admingroupid, issuerdata);
            } catch (CloneNotSupportedException e) {
            }
        }
        if (returnval) {
View Full Code Here

Examples of org.ejbca.core.model.hardtoken.HardTokenIssuer

        return exists;
    }

    @Override
    public boolean existsHardTokenProfileInHardTokenIssuer(Admin admin, int id) {
        HardTokenIssuer issuer = null;
        Collection<Integer> hardtokenissuers = null;
        boolean exists = false;
        Collection<org.ejbca.core.ejb.hardtoken.HardTokenIssuerData> result = org.ejbca.core.ejb.hardtoken.HardTokenIssuerData.findAll(entityManager);
        Iterator<org.ejbca.core.ejb.hardtoken.HardTokenIssuerData> i = result.iterator();
        while (i.hasNext() && !exists) {
            issuer = i.next().getHardTokenIssuer();
            hardtokenissuers = issuer.getAvailableHardTokenProfiles();
            if (hardtokenissuers.contains(Integer.valueOf(id))) {
                exists = true;
            }
        }
        return exists;
View Full Code Here

Examples of org.ejbca.core.model.hardtoken.HardTokenIssuer

     * Creates the 'Local' Hard Token Issuer
     *
     * @throws Exception
     */
    private void createLocalHardTokenIssuer(int admingroupid) throws Exception {
        HardTokenIssuer localissuer = new HardTokenIssuer();

        localissuer.setDescription("Issuer created by installation script, used to create the first administration token");

        ArrayList<Integer> availableprofiles = new ArrayList<Integer>();
        availableprofiles.add(Integer.valueOf(ejb.getHardTokenSession().getHardTokenProfileId(getAdmin(), ADMINTOKENPROFILENAME)));
        localissuer.setAvailableHardTokenProfiles(availableprofiles);

        this.ejb.getHardTokenSession().addHardTokenIssuer(getAdmin(), ISSUERALIAS, admingroupid, localissuer);

    }
View Full Code Here

Examples of org.ejbca.core.model.hardtoken.HardTokenIssuer

     * @throws Exception error
     */
    public void test01AddHardTokenIssuer() throws Exception {
        log.trace(">test01AddHardTokenIssuer()");
        boolean ret = false;
        HardTokenIssuer issuer = new HardTokenIssuer();
        issuer.setDescription("TEST");
        ret = hardTokenSession.addHardTokenIssuer(admin, "TEST", 3, issuer);
        assertTrue("Creating Hard Token Issuer failed", ret);
        log.trace("<test01AddHardTokenIssuer()");
    }
View Full Code Here

Examples of org.ejbca.core.model.hardtoken.HardTokenIssuer

   
    public void addHardTokenIssuer(String alias, int admingroupid) throws HardTokenIssuerExistsException {
        Iterator<AdminGroup> iter = this.informationmemory.getHardTokenIssuingAdminGroups().iterator();
        while (iter.hasNext()) {
            if (iter.next().getAdminGroupId() == admingroupid) {
                if (!hardtokensession.addHardTokenIssuer(admin, alias, admingroupid, new HardTokenIssuer())) {
                    throw new HardTokenIssuerExistsException();
                }
                informationmemory.hardTokenDataEdited();         
            }
        }     
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.