Code example for BigInteger

Methods: modPow

0
        DHPrivateKey dhPrivateKey = getPrivateKey();
        BigInteger xa = dhPrivateKey.getX();
        BigInteger yb = dhPublicKey.getY();
        BigInteger p  = _dhParameterSpec.getP();
 
        BigInteger zz = yb.modPow(xa, p);
 
        return _hDigest.digest(zz.toByteArray());
    } 
 
    private static boolean isDhSupported() 
    { 
        try 
        { 
            AlgorithmParameterGenerator.getInstance(ALGORITHM);
            KeyPairGenerator.getInstance(ALGORITHM);
            KeyFactory.getInstance(ALGORITHM);
 
            return true; 
        } 
Stop searching for code, let great code find you!  Add Codota to your java IDE