Search in sources :

Example 6 with KeystoreGenerationParameters

use of org.xipki.security.pkcs12.KeystoreGenerationParameters in project xipki by xipki.

the class P12AESGmacSignLoadTest method generateKeystore.

private static byte[] generateKeystore(String signatureAlgorithm) throws Exception {
    int keysize = getKeysize(signatureAlgorithm);
    P12KeyGenerationResult identity = new P12KeyGenerator().generateSecretKey("AES", keysize, new KeystoreGenerationParameters(PASSWORD.toCharArray()));
    return identity.keystore();
}
Also used : P12KeyGenerator(org.xipki.security.pkcs12.P12KeyGenerator) P12KeyGenerationResult(org.xipki.security.pkcs12.P12KeyGenerationResult) KeystoreGenerationParameters(org.xipki.security.pkcs12.KeystoreGenerationParameters)

Example 7 with KeystoreGenerationParameters

use of org.xipki.security.pkcs12.KeystoreGenerationParameters in project xipki by xipki.

the class P12DSASignLoadTest method generateKeystore.

private static byte[] generateKeystore(int plength, int qlength) throws Exception {
    byte[] keystoreBytes = getPrecomputedDSAKeystore(plength, qlength);
    if (keystoreBytes == null) {
        KeystoreGenerationParameters params = new KeystoreGenerationParameters(PASSWORD.toCharArray());
        params.setRandom(new SecureRandom());
        P12KeyGenerationResult identity = new P12KeyGenerator().generateDSAKeypair(plength, qlength, params, null);
        keystoreBytes = identity.keystore();
    }
    return keystoreBytes;
}
Also used : P12KeyGenerator(org.xipki.security.pkcs12.P12KeyGenerator) P12KeyGenerationResult(org.xipki.security.pkcs12.P12KeyGenerationResult) SecureRandom(java.security.SecureRandom) KeystoreGenerationParameters(org.xipki.security.pkcs12.KeystoreGenerationParameters)

Aggregations

KeystoreGenerationParameters (org.xipki.security.pkcs12.KeystoreGenerationParameters)7 P12KeyGenerationResult (org.xipki.security.pkcs12.P12KeyGenerationResult)6 P12KeyGenerator (org.xipki.security.pkcs12.P12KeyGenerator)6 SecureRandom (java.security.SecureRandom)5