public boolean verifySignedPip(ASN1Sequence signedPip) throws BsnkException {
        ASN1Sequence signedPipContent = (ASN1Sequence) signedPip.getObjectAt(1);
        ASN1Sequence pipSignatureSequence = (ASN1Sequence) signedPip.getObjectAt(2);
        ASN1Sequence pipSignature = (ASN1Sequence) pipSignatureSequence.getObjectAt(1);

        byte[] pipBytes;
        try {
            pipBytes = signedPipContent.getEncoded();
        } catch (IOException ex) {
            throw new BsnkException("SignedPipIOFault", "Failed to get byte[] from pip or pip signature.", ex);
        }

        BigInteger pipKsv = ((ASN1Integer) signedPipContent.getObjectAt(2)).getValue();

        if (!pipKsv.equals(bsnkUKsv)) {
            throw new BsnkException("SignedpipKsvMismatch",
                    String.format("Signedpip ksv mismatch. U: '%s'. Pip: '%s'", bsnkUKsv, pipKsv), null);
        }

        String oid = ((ASN1ObjectIdentifier) pipSignatureSequence.getObjectAt(0)).getId();
        BigInteger r = ((ASN1Integer) pipSignature.getObjectAt(0)).getValue();
        BigInteger s = ((ASN1Integer) pipSignature.getObjectAt(1)).getValue();
        SignatureEcdsa signature = (SignatureEcdsa) SignatureEcdsa.from(oid, r, s);

        try {
            signature.verify(bsnkUPubkey, pipBytes);
            return true;
        } catch (CryptoException ex) {
            logger.error(String.format("Exception during pip verification: '%s", ex.getMessage()));
            return false;
        }
    }
@Test
    public void verifySignedPipFailTest() throws IOException, BsnkException, InvalidKeySpecException,
            NoSuchAlgorithmException, NoSuchProviderException {
        String invalidUBase64 = "SSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSSS";
        ECPublicKey invalidU = (ECPublicKey) PublicKeyParser.decodeKey(Base64.getDecoder().decode(invalidUBase64));
        ReflectionTestUtils.setField(bsnkUtil, "bsnkUPubkey", invalidU);

        assertFalse(bsnkUtil.verifySignedPip(signedPip));
    }