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

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


     * @throws Exception
     */
    public void test03ExportRemoveRestoreSHA1WithECDSAForSigning() throws Exception {
        log.trace(">test03ExportRemoveRestoreSHA1WithECDSAForSigning()");

        SoftCATokenInfo catokeninfo = new SoftCATokenInfo();
        catokeninfo.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_ECDSA);
        catokeninfo.setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_ECDSA);
        catokeninfo.setSignKeySpec("prime192v1");
        catokeninfo.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA256_WITH_RSA);
        catokeninfo.setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        catokeninfo.setEncKeySpec("1024");
        exportRemoveRestore(catokeninfo);

        log.trace("<test03ExportRemoveRestoreSHA1WithECDSAForSigning()");
    }
View Full Code Here


     * @throws Exception
     */
    public void test04ExportRemoveRestoreSHA1WithDSAForSigning() throws Exception {
        log.trace(">test04ExportRemoveRestoreSHA1WithDSAForSigning()");

        SoftCATokenInfo catokeninfo = new SoftCATokenInfo();
        catokeninfo.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_DSA);
        catokeninfo.setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_DSA);
        catokeninfo.setSignKeySpec("1024");
        catokeninfo.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA256_WITH_RSA);
        catokeninfo.setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        catokeninfo.setEncKeySpec("1024");
        exportRemoveRestore(catokeninfo);

        log.trace("<test04ExportRemoveRestoreSHA1WithDSAForSigning()");
    }
View Full Code Here

        byte[] keystorebytes2 = null;
        byte[] keystorebytes3 = null;

        // CA using SHA1withRSA and 2048 bit RSA KEY
        String caname1 = "TestExportRemoveRestoreCA1";
        SoftCATokenInfo catokeninfo1 = new SoftCATokenInfo();
        catokeninfo1.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        catokeninfo1.setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        catokeninfo1.setSignKeySpec("2048");
        catokeninfo1.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        catokeninfo1.setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        catokeninfo1.setEncKeySpec("2048");
        X509CAInfo cainfo1 = getNewCAInfo(caname1, catokeninfo1);

        // This CA uses DSA instead
        String caname2 = "TestExportRemoveRestoreCA2";
        SoftCATokenInfo catokeninfo2 = new SoftCATokenInfo();
        catokeninfo2.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_DSA);
        catokeninfo2.setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_DSA);
        catokeninfo2.setSignKeySpec("1024");
        catokeninfo2.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        catokeninfo2.setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        catokeninfo2.setEncKeySpec("1024");
        X509CAInfo cainfo2 = getNewCAInfo(caname2, catokeninfo2);

        // This CA uses RSA but with 1024 bits
        String caname3 = "TestExportRemoveRestoreCA3";
        SoftCATokenInfo catokeninfo3 = new SoftCATokenInfo();
        catokeninfo3.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        catokeninfo3.setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        catokeninfo3.setSignKeySpec("1024");
        catokeninfo3.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        catokeninfo3.setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        catokeninfo3.setEncKeySpec("1024");
        X509CAInfo cainfo3 = getNewCAInfo(caname3, catokeninfo3);

        // Remove CAs if they already exists
        try {
            caSession.removeCA(admin, cainfo1.getCAId());
View Full Code Here

        String capassword = "foo123";
        byte[] keystorebytes1 = null;

        // CA1
        String caname1 = "TestExportRemoveRestoreCA1";
        SoftCATokenInfo catokeninfo1 = new SoftCATokenInfo();
        catokeninfo1.setSignatureAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        catokeninfo1.setSignKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        catokeninfo1.setSignKeySpec("2048");
        catokeninfo1.setEncryptionAlgorithm(AlgorithmConstants.SIGALG_SHA1_WITH_RSA);
        catokeninfo1.setEncKeyAlgorithm(AlgorithmConstants.KEYALGORITHM_RSA);
        catokeninfo1.setEncKeySpec("2048");
        X509CAInfo cainfo1 = getNewCAInfo(caname1, catokeninfo1);

        // Remove if they already exists
        try {
            caSession.removeCA(admin, cainfo1.getCAId());
View Full Code Here

TOP

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

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.