Code example for KeyPair

0
 
        AsymmetricCipherKeyPair pair = engine.generateKeyPair();
        DSAPublicKeyParameters pub = (DSAPublicKeyParameters)pair.getPublic();
        DSAPrivateKeyParameters priv = (DSAPrivateKeyParameters)pair.getPrivate();
 
        return new KeyPair(new BCDSAPublicKey(pub),
            new BCDSAPrivateKey(priv));
    } 
} 
Connect your IDE to all the code out there  Get Codota for Java