Code example for KeyPairGenerator

Methods: generateKeyPair

0
        generator = getGenerator();
        keyPair = getKeyPair();
    } 
 
    private KeyPair getKeyPair() {
        return generator.generateKeyPair();
    } 
 
    private KeyPairGenerator getGenerator() {
        try { 
            return KeyPairGenerator.getInstance(keyAlgorithmName);
        } catch (NoSuchAlgorithmException e) {
            fail(e.getMessage());
        } 
        return null; 
    } 
 
    @TestTargets({ 
        @TestTargetNew( 
                level = TestLevel.ADDITIONAL, 
                method = "getInstance",