Package org.ejbca.core.model.ca.catoken

Examples of org.ejbca.core.model.ca.catoken.CATokenInfo


     *
     * @throws Exception
     */
  public void test03ImportExportSHA256withRSA() throws Exception {
      log.trace("<test03ImportExport..()");
        CATokenInfo catokeninfo = new SoftCATokenInfo();
        catokeninfo.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA256_WITH_RSA);
        ((SoftCATokenInfo) catokeninfo).setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        ((SoftCATokenInfo) catokeninfo).setSignKeySpec("2048");
        catokeninfo.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        ((SoftCATokenInfo) catokeninfo).setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        ((SoftCATokenInfo) catokeninfo).setEncKeySpec("2048");
        subTest(catokeninfo);
      log.trace("<test03ImportExport()");
  } // test03ImportExport
View Full Code Here


     *
     * @throws Exception
     */
  public void test04ImportExportSHA256withECDSA() throws Exception {
      log.trace("<test04ImportExport..()");
      CATokenInfo catokeninfo = new SoftCATokenInfo();
        catokeninfo.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA256_WITH_ECDSA);
        ((SoftCATokenInfo) catokeninfo).setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_ECDSA);
        ((SoftCATokenInfo) catokeninfo).setSignKeySpec("prime192v1");
        catokeninfo.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        ((SoftCATokenInfo) catokeninfo).setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        ((SoftCATokenInfo) catokeninfo).setEncKeySpec("2048");
        subTest(catokeninfo);
      log.trace("<test04ImportExport()");
  } // test04ImportExport
View Full Code Here

     *
     * @throws Exception
     */
  public void test05ImportExportAccess() throws Exception {
      log.trace("<test05ImportExport..()");
      CATokenInfo catokeninfo = new SoftCATokenInfo();
        catokeninfo.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA256_WITH_ECDSA);
        ((SoftCATokenInfo) catokeninfo).setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_ECDSA);
        ((SoftCATokenInfo) catokeninfo).setSignKeySpec("prime192v1");
        catokeninfo.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        ((SoftCATokenInfo) catokeninfo).setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        ((SoftCATokenInfo) catokeninfo).setEncKeySpec("2048");
    subTestPublicAccess(catokeninfo, new Admin(Admin.TYPE_PUBLIC_WEB_USER));
      log.trace("<test05ImportExport()");
  } // test05ImportExport
View Full Code Here

     *
     * @throws Exception
     */
  public void test06ImportExportSHA1withDSA() throws Exception {
      log.trace("<test06ImportExport..()");
        CATokenInfo catokeninfo = new SoftCATokenInfo();
        catokeninfo.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_DSA);
        ((SoftCATokenInfo) catokeninfo).setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_DSA);
        ((SoftCATokenInfo) catokeninfo).setSignKeySpec("1024");
        catokeninfo.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        ((SoftCATokenInfo) catokeninfo).setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        ((SoftCATokenInfo) catokeninfo).setEncKeySpec("2048");
        subTest(catokeninfo);
      log.trace("<test06ImportExport()");
  } // test02ImportExport
View Full Code Here

            }
            gen.addSigner(getCAToken().getPrivateKey(SecConst.CAKEYPURPOSE_CERTSIGN), (X509Certificate)getCACertificate(), CMSSignedGenerator.DIGEST_SHA1);
            gen.addCertificatesAndCRLs(certs);
            CMSSignedData s = null;
            CATokenContainer catoken = getCAToken();
            CATokenInfo tokeninfo = getCAInfo().getCATokenInfo();
            if (catoken != null && !(tokeninfo instanceof NullCATokenInfo)) {
              log.debug("createPKCS7: Provider="+catoken.getProvider()+" using algorithm "+getCAToken().getPrivateKey(SecConst.CAKEYPURPOSE_CERTSIGN).getAlgorithm());
              s = gen.generate(msg, true, catoken.getProvider());
            } else {
              String msg1 = "CA Token does not exist!";
View Full Code Here

        log.debug("CA "+caname+" expires on "+expire);
        if (expire.before(new Date(expiretime))) {
          try {
            // Only try to renew active CAs
            // There should be other monitoring available to check if CAs that should not be off-line are off-line (HealthCheck)
            CATokenInfo tokeninfo = info.getCATokenInfo();
            log.debug("CA status is "+info.getStatus()+", CA token status is "+tokeninfo.getCATokenStatus());
            if ( (info.getStatus() == SecConst.CA_ACTIVE) && (tokeninfo.getCATokenStatus() == ICAToken.STATUS_ACTIVE) ) {
              caAdminSession.renewCA(getAdmin(), info.getCAId(), null, isRenewKeys());         
            } else {
              log.debug("Not trying to renew CA because CA and token status are not on-line.");
            }
          } catch (CADoesntExistsException e) {
View Full Code Here

TOP

Related Classes of org.ejbca.core.model.ca.catoken.CATokenInfo

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.