code: public final void initVerify(Certificate certificate)
              throws InvalidKeyException {
          // If the certificate is of type X509Certificate,
          // we should check whether it has a Key Usage
          // extension marked as critical.
          if (certificate instanceof java.security.cert.X509Certificate) {
              // Check whether the cert has a key usage extension
              // marked as a critical extension.
              // The OID for KeyUsage extension is 2.5.29.15.
              X509Certificate cert = (X509Certificate)certificate;
              Set<String> critSet = cert.getCriticalExtensionOIDs();
  
              if (critSet != null && !critSet.isEmpty()
                  && critSet.contains("2.5.29.15")) {
                  boolean[] keyUsageInfo = cert.getKeyUsage();
                  // keyUsageInfo[0] is for digitalSignature.
                  if ((keyUsageInfo != null) && (keyUsageInfo[0] == false))
                      throw new InvalidKeyException("Wrong key usage");
              }
          }
  
          PublicKey publicKey = certificate.getPublicKey();
          engineInitVerify(publicKey);
          state = VERIFY;
  
          // BEGIN Android-removed: this debugging mechanism is not supported in Android.
          /*
          if (!skipDebug && pdebug != null) {
              pdebug.println("Signature." + algorithm +
                  " verification algorithm from: " + this.provider.getName());
          }
          */
          // END Android-removed: this debugging mechanism is not supported in Android.
      }
docs: Initializes this object for verification, using the public key from
  the given certificate.
  <p>If the certificate is of type X.509 and has a <i>key usage</i>
  extension field marked as critical, and the value of the <i>key usage</i>
  extension field implies that the public key in
  the certificate and its corresponding private key are not
  supposed to be used for digital signatures, an
  {@code InvalidKeyException} is thrown.
  
  @param certificate the certificate of the identity whose signature is
  going to be verified.
  
  @exception InvalidKeyException  if the public key in the certificate
  is not encoded properly or does not include required  parameter
  information or cannot be used for digital signature purposes.
  @since 1.3