java – Is a Public key from a certificate always valid?

Okay so i have a .cer file which has a certificate key like

-----BEGIN CERTIFICATE-----
.....A1NuUYdviJSQOLhkL8WgtEpocv1u2mv9DQcMJWoA
-----END CERTIFICATE-----

I am using this public key to verify a response i get from a third party server. I am using the

Signature.verify 

method of java security. My issue is that even if i tamper the certificate like

-----BEGIN CERTIFICATE-----
.....A1NuUYdviJSQOLhkL8WgtEpocv1u2mv9DQcMJ111
-----END CERTIFICATE-----

I am still able to verify my data. Am i doing something wrong or am i not understanding something.