Code example for DHPublicKey

Methods: getY

0
        return macKey;
    } 
 
    protected static String publicKeyToString(DHPublicKey publicKey)
    { 
        return new String(Base64.encodeBase64(publicKey.getY().toByteArray()));
    } 
 
    protected DHPublicKey stringToPublicKey(String publicKeyBase64)
    { 
        try 
        { 
            byte[] yBinary = Base64.decodeBase64(publicKeyBase64.getBytes());
            BigInteger y = new BigInteger(yBinary);
 
            DHPublicKeySpec dhPublicKeySpec = new DHPublicKeySpec(
                    y, _dhParameterSpec.getP(), _dhParameterSpec.getG() );
 
            KeyFactory keyFactory = KeyFactory.getInstance(ALGORITHM);
 
Connect your IDE to all the code out there  Get Codota for Java