Search in sources :

Example 11 with P12KeyGenerator

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

the class P12RSAKeyGenCmd method execute0.

@Override
protected Object execute0() throws Exception {
    if (keysize % 1024 != 0) {
        throw new IllegalCmdParamException("keysize is not multiple of 1024: " + keysize);
    }
    P12KeyGenerationResult keypair = new P12KeyGenerator().generateRSAKeypair(keysize, toBigInt(publicExponent), getKeyGenParameters(), subject);
    saveKey(keypair);
    return null;
}
Also used : P12KeyGenerator(org.xipki.security.pkcs12.P12KeyGenerator) P12KeyGenerationResult(org.xipki.security.pkcs12.P12KeyGenerationResult) IllegalCmdParamException(org.xipki.console.karaf.IllegalCmdParamException)

Aggregations

P12KeyGenerationResult (org.xipki.security.pkcs12.P12KeyGenerationResult)11 P12KeyGenerator (org.xipki.security.pkcs12.P12KeyGenerator)11 KeystoreGenerationParameters (org.xipki.security.pkcs12.KeystoreGenerationParameters)6 SecureRandom (java.security.SecureRandom)4 IllegalCmdParamException (org.xipki.console.karaf.IllegalCmdParamException)3