sdk/src/main/java/com/worldpay/cse/WorldpayCSE.java
public static boolean isValidPublicKey(String stringKey) {
        try {
            WPPublicKey.parseKey(stringKey);
        } catch (WPCSEInvalidPublicKey e) {
            LOGGER.log(Level.INFO, e.getMessage(), e);
            return false;
        }
        return true;
    }
/**
     * Validates in a more convenient way if the public key is valid. May be useful before calling {@link WorldpayCSE#setPublicKey(String)}
     * method and you do not want to handle WPCSEInvalidPublicKey exception.
     *
     * @param stringKey the public key in plain string format
     * @return true if valid
     */
Validates in a more convenient way if the public key is valid. May be useful before calling  WorldpayCSE#setPublicKey(String)
method and you do not want to handle WPCSEInvalidPublicKey exception.

@param stringKey the public key in plain string format
@return true if valid
Validates in a more convenient way if the public key is valid . May be useful before calling WorldpayCSE#setPublicKey ( String ) method and you do not want to handle WPCSEInvalidPublicKey exception . @param stringKey the public key in plain string format @return true if valid
public static boolean isValidPublicKey(String stringKey) {
        try {
            WPPublicKey.parseKey(stringKey);
        } catch (WPCSEInvalidPublicKey e) {
            LOGGER.log(Level.INFO, e.getMessage(), e);
            return false;
        }
        return true;
    }
public static boolean isValidPublicKey ( String stringKey ) { try { WPPublicKey . parseKey ( stringKey ) ; } catch ( WPCSEInvalidPublicKey e ) { LOGGER . log ( Level . INFO , e . getMessage ( ) , e ) ; return false ; } return true ; }
Validates in a more convenient way if the public key is valid.
Validates in a more convenient way if the public key is valid .