check whether the issuer public key is correct

@return true iff valid
345793
public boolean check() {
        // check formalities of IdemixIssuerPublicKey
        if (AttributeNames == null || Hsk == null || HRand == null || HAttrs == null
                || BarG1 == null || BarG1.is_infinity() || BarG2 == null
                || HAttrs.length < AttributeNames.length) {
            return false;
        }

        for (int i = 0; i < AttributeNames.length; i++) {
            if (HAttrs[i] == null) {
                return false;
            }
        }

        // check proofs
        ECP2 t1 = IdemixUtils.genG2.mul(ProofS);
        ECP t2 = BarG1.mul(ProofS);

        t1.add(W.mul(BIG.modneg(ProofC, IdemixUtils.GROUP_ORDER)));
        t2.add(BarG2.mul(BIG.modneg(ProofC, IdemixUtils.GROUP_ORDER)));

        // Generating proofData that will contain 3 elements in G1 (of size 2*FIELD_BYTES+1)and 3 elements in G2 (of size 4 * FIELD_BYTES)
        byte[] proofData = new byte[0];
        proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(t1));
        proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(t2));
        proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(IdemixUtils.genG2));
        proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(BarG1));
        proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(W));
        proofData = IdemixUtils.append(proofData, IdemixUtils.ecpToBytes(BarG2));

        // Hash proofData to hproofdata and compare with proofC
        return Arrays.equals(IdemixUtils.bigToBytes(IdemixUtils.hashModOrder(proofData)), IdemixUtils.bigToBytes(ProofC));
    }
855647
def valid_public_key?(point)
      return false if point.group != self
      return false if point.infinity?
      return false if !point_satisfies_equation?(point)
      point.multiply_by_scalar(order).infinity?
    end
441313
private function isValidKeyPair(PrivateKey $private, PublicKey $public = null) : bool
    {
        // If no public key was supplied, the public key will be extracted from the private key.
        if ($public === null) {
            return true;
        }

        // If the public key extracted from the private key matches the supplied public key, the pair must be valid.
        if ($private->getPublicKey() == $public) {
            return true;
        }

        return false;
    }
1356194
def validate_public_key(value):
    
    is_valid = False
    exc = None

    for load in (load_pem_public_key, load_ssh_public_key):
        if not is_valid:
            try:
                load(value.encode('utf-8'), default_backend())
                is_valid = True
            except Exception as e:
                exc = e

    if not is_valid:
        raise ValidationError('Public key is invalid: %s' % exc)
806897
public function isValidPublicKey($key)
    {
        $data = ['public_integration_key' => $key];
        try {
            $response = $this->getHttpClient()->validatePublicKey($data);

            return $response['status'] === 'SUCCESS';
        } catch (\Exception $e) {
            if ($e->getCode() === 409) {
                return false;
            }

            throw $e;
        }
    }
873440
@SuppressWarnings("unused")
    public static boolean isTokenValid(byte[] secret, String oid, String token) {
        if (S.anyBlank(oid, token)) {
            return false;
        }
        String s = Crypto.decryptAES(token, secret);
        String[] sa = s.split("\\|");
        if (sa.length < 2) return false;
        if (!S.isEqual(oid, sa[0])) return false;
        try {
            long due = Long.parseLong(sa[1]);
            return (due < 1 || due > System.currentTimeMillis());
        } catch (Exception e) {
            return false;
        }
    }
360412
public static boolean secKeyVerify(byte[] seckey) {
        Preconditions.checkArgument(seckey.length == 32);

        ByteBuffer byteBuff = nativeECDSABuffer.get();
        if (byteBuff == null || byteBuff.capacity() < seckey.length) {
            byteBuff = ByteBuffer.allocateDirect(seckey.length);
            byteBuff.order(ByteOrder.nativeOrder());
            nativeECDSABuffer.set(byteBuff);
        }
        byteBuff.rewind();
        byteBuff.put(seckey);

        r.lock();
        try {
            return secp256k1_ec_seckey_verify(byteBuff, Secp256k1Context.getContext()) == 1;
        } finally {
            r.unlock();
        }
    }
1195963
public function isValid() {
		$this->apiTokens = $this->_loadApiTokens ();
		$key = $this->_getHeaderToken ();
		if ($this->apiTokens->isExpired ( $key )) {
			return false;
		} else {
			$this->_addHeaderToken ( $key );
			return true;
		}
	}
218087
public boolean isValid() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "Checking validity of token " + this.getClass().getName());

        if (token != null) {
            // return if this token is still valid
            long currentTime = System.currentTimeMillis();
            long expiration = getExpiration();
            long timeleft = expiration - currentTime;

            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "Time left for token: " + timeleft);

            if (timeleft > 0) {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "token is valid.");
                return true;
            } else {
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                    Tr.debug(tc, "token is invalid.");
                return false;
            }
        } else {
            if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
                Tr.debug(tc, "token is null, returning invalid.");
            return false;
        }
    }
1070801
private boolean isValid() {

        return m_typeID.isValid()
            && m_typeShortName.isValid()
            && m_parentFormatter.isValid()
            && m_parentSchema.isValid()
            && m_bundle.isValid()
            && m_config.isValid()
            && m_typeDescription.isValid()
            && m_typeName.isValid()
            && m_typeXPathName.isValid();
    }
883142
public boolean setPublicKey (PublicKey key)
    {
        if (SecureUtil.ciphersSupported(key)) {
            _publicKey = key;
            return true;
        }
        return false;
    }
844289
public boolean validate()
  {
    boolean correct = true;
    if (population() > 1)
    {
      java.util.Comparator comp = index().insertComparator();
      int xcc = 0;
      for (int i = 0; i < population()-1; i++)
      {
        xcc = comp.compare(_nodeKey[i], _nodeKey[i+1]);
        if ( !(xcc < 0) )
          {
            System.out.println("Entry " + i + " not less than entry " + i+1);
            correct = false;
          }
      }
    }
    return correct;
  }
145608
public boolean verify(byte[] data, byte[] sign, byte[] id) {
		lock.lock();
		final SM2Signer signer = getSigner();
		try {
			CipherParameters param = getCipherParameters(KeyType.PublicKey);
			if (id != null) {
				param = new ParametersWithID(param, id);
			}
			signer.init(false, param);
			signer.update(data, 0, data.length);
			return signer.verifySignature(sign);
		} catch (Exception e) {
			throw new CryptoException(e);
		} finally {
			lock.unlock();
		}
	}
1081418
def verify_key (self, acctname=None, tokenkey=None):
        ''' 
        '''
        if (re.match( r'^[A-Za-z0-9]+$', tokenkey)
                        and tokenkey is not None
                        and len(tokenkey) <= 64
                        and len(tokenkey) >= 16):
            pubkey = PrivateKey(tokenkey).pubkey or 0
            pubkey2 = self.account(acctname)
            if (str(pubkey) 
                    == str(pubkey2['posting']['key_auths'][0][0])):
                self.privatekey = tokenkey
                self.refreshtoken = None
                self.accesstoken = None
                return True
            else:
                return False
        elif (re.match( r'^[A-Za-z0-9\-\_\.]+$', tokenkey)
                        and tokenkey is not None
                        and len(tokenkey) > 64):
            self.privatekey = None
            self.accesstoken = self.connect.get_token(tokenkey)
            if self.accesstoken:
                self.username = self.connect.username
                self.refreshtoken = self.connect.refresh_token
                return True
            else:
                return False
        else:
            return False
544932
public function valid()
    {

        if ($this->container['orderId'] === null) {
            return false;
        }
        if ($this->container['typeId'] === null) {
            return false;
        }
        if ($this->container['regionId'] === null) {
            return false;
        }
        if ($this->container['locationId'] === null) {
            return false;
        }
        if ($this->container['range'] === null) {
            return false;
        }
        $allowedValues = $this->getRangeAllowableValues();
        if (!in_array($this->container['range'], $allowedValues)) {
            return false;
        }
        if ($this->container['isBuyOrder'] === null) {
            return false;
        }
        if ($this->container['price'] === null) {
            return false;
        }
        if ($this->container['volumeTotal'] === null) {
            return false;
        }
        if ($this->container['volumeRemain'] === null) {
            return false;
        }
        if ($this->container['issued'] === null) {
            return false;
        }
        if ($this->container['state'] === null) {
            return false;
        }
        $allowedValues = $this->getStateAllowableValues();
        if (!in_array($this->container['state'], $allowedValues)) {
            return false;
        }
        if ($this->container['minVolume'] === null) {
            return false;
        }
        if ($this->container['walletDivision'] === null) {
            return false;
        }
        if ($this->container['walletDivision'] > 7) {
            return false;
        }
        if ($this->container['walletDivision'] < 1) {
            return false;
        }
        if ($this->container['duration'] === null) {
            return false;
        }
        if ($this->container['escrow'] === null) {
            return false;
        }
        return true;
    }
665777
public function isValid()
    {
        //validate directPayment values
        $checkEmpty = array($this->ipAddress, $this->acct, $this->firstName, $this->lastName);

        if(!$this->checkEmpty($checkEmpty) || is_null($this->_address)) {
            return false;
        }

        //address fields
        $address = $this->_address;

        $test = array(
            $address->getStreet(),
            $address->getCity(),
            $address->getState(),
            $address->getCountryCode(),
            $address->getZip()
        );

        if(!$this->checkEmpty($test) || is_null($this->_paymentDetails)) {
            return false;
        }

        $amt = $this->_paymentDetails->getAmt();
        if(empty($amt)) {
            return false;
        }

        //payment details payment action cannot be order
        if($this->_paymentDetails->getPaymentAction() == "Order") {
            return false;
        }

        return true;
    }
192272
public static boolean verify(byte[] data, byte[] signature, byte[] pub) {
        return verify(data, ECDSASignature.decodeFromDER(signature), pub);
    }