Code example for InvalidKeyException

Methods: getMessageprintStackTrace

            try { 
            } catch (InvalidKeyException e) {
                Log.e(TAG, " failed!  initializing verification");
                Log.e(TAG, String.format(" Reason = %s", e.getMessage()));
                return false; 
            // base64 decoding for signature file 
            olen = signature.length;
            CryptLog.i(DebugFlag, TAG, String.format(" SigLen = %d", olen));
            CryptLog.i(DebugFlag, TAG, " Verifying the RSA/SHA-1 signature");
            try { 
                signer.update(ptext, 0, ptext.length);
                if (!signer.verify(signature)) {
                    Log.e(TAG, " failed! signature verification");
                    return false; 
Connect your IDE to all the code out there  Get Codota for Java