读取数字签名文件 根据公匙，签名，信息验证信息的合法性

@return true 验证成功 false 验证失败
190892
public static boolean validateSign(String signfile) {
		// 读取公匙
		PublicKey mypubkey = (PublicKey) getObjFromFile(signfile, 2);
		// 读取签名
		byte[] signed = (byte[]) getObjFromFile(signfile, 1);
		// 读取信息
		String info = (String) getObjFromFile(signfile, 3);
		try {
			// 初始一个Signature对象,并用公钥和签名进行验证
			Signature signetcheck = Signature.getInstance("DSA");
			// 初始化验证签名的公钥
			signetcheck.initVerify(mypubkey);
			// 使用指定的 byte 数组更新要签名或验证的数据
			signetcheck.update(info.getBytes());
			System.out.println(info);
			// 验证传入的签名
			return signetcheck.verify(signed);
		} catch (Exception e) {
			e.printStackTrace();
			return false;
		}
	}
775622
public boolean isSignatureValid() {
        try {
            return ECKey.verify(Sha256Hash.hashTwice(content), signature, params.getAlertSigningKey());
        } catch (SignatureDecodeException e) {
            return false;
        }
    }
236484
public function getSign()
    {
        foreach ($this->getMap() as $name => $method) {
            // Call associated method dynamically
            if (call_user_func(array($this, $method))) {
                return $name;
            }
        }

        // On failure
        return false;
    }
1297027
public function makeSign()
	{
		//签名步骤一：按字典序排序参数
		ksort($this->values);
		$string = $this->toUrlParams();
		//签名步骤二：在string后加入KEY
		$string = $string . '&key=' . Wxpay::getConfig('key');
		//签名步骤三：MD5加密
		$string = md5($string);
		//签名步骤四：所有字符转为大写
		$result = strtoupper($string);
		return $result;
	}
371558
public static function isGzEnabled()
	{
		static $isGzEnabled = null;
		if (null === $isGzEnabled) {
			// 配置文件中启用gzip
			$isGzEnabled = cfg('gzcompress') 
			// 客户端支持gzip
			  && strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false
			  // 服务器端支持gzip
			  && (ini_get("zlib.output_compression") == 1 || in_array('ob_gzhandler', ob_list_handlers()));
		}
		
		return $isGzEnabled;
	}
512160
public boolean hasValidCredentials() {
        String encryptedEncoded = storage.retrieveString(KEY_CREDENTIALS);
        Long expiresAt = storage.retrieveLong(KEY_EXPIRES_AT);
        Boolean canRefresh = storage.retrieveBoolean(KEY_CAN_REFRESH);
        return !(isEmpty(encryptedEncoded) ||
                expiresAt == null ||
                expiresAt <= getCurrentTimeInMillis() && (canRefresh == null || !canRefresh));
    }
516663
public static boolean isSeparateChecksumBlockFilename(String name) {
    if (isBlockFileName(name) && name.indexOf('.') < 0
        && name.indexOf('_', BLOCK_FILE_PREFIX.length()) < 0) {
      return true;
    } 
    return false;
  }
381906
boolean verifySigned(File keystore, Certificate agentCertificate) {
        try {
            KeyStore store = KeyStore.getInstance("JKS");
            FileInputStream inputStream = new FileInputStream(keystore);
            store.load(inputStream, PASSWORD_AS_CHAR_ARRAY);
            IOUtils.closeQuietly(inputStream);
            KeyStore.PrivateKeyEntry intermediateEntry = (KeyStore.PrivateKeyEntry) store.getEntry("ca-intermediate",
                    new KeyStore.PasswordProtection(PASSWORD_AS_CHAR_ARRAY));
            Certificate intermediateCertificate = intermediateEntry.getCertificate();
            agentCertificate.verify(intermediateCertificate.getPublicKey());
            return true;
        } catch (Exception e) {
            return false;
        }
    }
757588
protected function tmpfilename()
    {
        if (is_null($this->tmpfilename) === true) {
            $this->tmpfilename = $this->files->tmpfilename($this->name, $this->token);
        }

        return $this->tmpfilename;
    }
244918
public static function check_filename(): bool
  {

    $args = \func_get_args();
    // Each argument must be a string starting with a letter, and having than one character made of letters, numbers and underscores
    foreach ( $args as $a ){
      if ( !\is_string($a) || (strpos($a, '/') !== false) || (strpos($a, '\\') !== false) ){
        return false;
      }
    }
    return true;
  }
334311
public function MakeSign()
	{
		//签名步骤一：按字典序排序参数
		ksort($this->values);
		$string = $this->ToUrlParams();
		//签名步骤二：在string后加入KEY
		$string = $string . "&key=".WxPayConfig::$KEY;
		//签名步骤三：MD5加密
		$string = md5($string);
		//签名步骤四：所有字符转为大写
		$result = strtoupper($string);
		return $result;
	}
1061409
public boolean actionAddAce() {

        String file = getParamResource();
        String name = getParamName();
        String type = getParamType();
        int arrayPosition = -1;
        try {
            arrayPosition = Integer.parseInt(type);
        } catch (Exception e) {
            // can usually be ignored
            if (LOG.isInfoEnabled()) {
                LOG.info(e.getLocalizedMessage());
            }
        }

        if (checkNewEntry(name, arrayPosition)) {
            String permissionString = "";
            if (getInheritOption() && getSettings().getUserSettings().getDialogPermissionsInheritOnFolder()) {
                // inherit permissions on folders if setting is enabled
                permissionString = "+i";
            }
            try {
                // lock resource if autolock is enabled
                checkLock(getParamResource());
                if (name.equals(key(Messages.GUI_LABEL_ALLOTHERS_0))) {
                    getCms().chacc(
                        file,
                        getTypes(false)[arrayPosition],
                        CmsAccessControlEntry.PRINCIPAL_ALL_OTHERS_NAME,
                        permissionString);
                } else if (name.equals(key(Messages.GUI_LABEL_OVERWRITEALL_0))) {
                    getCms().chacc(
                        file,
                        getTypes(false)[arrayPosition],
                        CmsAccessControlEntry.PRINCIPAL_OVERWRITE_ALL_NAME,
                        permissionString);
                } else {
                    if (getTypes(false)[arrayPosition].equalsIgnoreCase(CmsRole.PRINCIPAL_ROLE)) {
                        // if role, first check if we have to translate the role name
                        CmsRole role = CmsRole.valueOfRoleName(name);
                        if (role == null) {
                            // we need translation
                            Iterator<CmsRole> it = CmsRole.getSystemRoles().iterator();
                            while (it.hasNext()) {
                                role = it.next();
                                if (role.getName(getLocale()).equalsIgnoreCase(name)) {
                                    name = role.getRoleName();
                                    break;
                                }
                            }
                        }
                    }
                    getCms().chacc(file, getTypes(false)[arrayPosition], name, permissionString);
                }
                return true;
            } catch (CmsException e) {
                m_errorMessages.add(e.getMessage());
                if (LOG.isErrorEnabled()) {
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
        }
        return false;
    }
686774
public static boolean signBySecureKey(Map<String, String> data, String secureKey,
			String encoding) {
		
		if (isEmpty(encoding)) {
			encoding = "UTF-8";
		}
		if (isEmpty(secureKey)) {
			LogUtil.writeErrorLog("secureKey is empty");
			return false;
		}
		String signMethod = data.get(param_signMethod);
		if (isEmpty(signMethod)) {
			LogUtil.writeErrorLog("signMethod must Not null");
			return false;
		}
		
		if (SIGNMETHOD_SHA256.equals(signMethod)) {
			// 将Map信息转换成key1=value1&key2=value2的形式
			String stringData = coverMap2String(data);
			LogUtil.writeLog("待签名请求报文串:[" + stringData + "]");
			String strBeforeSha256 = stringData
					+ SDKConstants.AMPERSAND
					+ SecureUtil.sha256X16Str(secureKey, encoding);
			String strAfterSha256 = SecureUtil.sha256X16Str(strBeforeSha256,
					encoding);
			// 设置签名域值
			data.put(SDKConstants.param_signature, strAfterSha256);
			return true;
		} else if (SIGNMETHOD_SM3.equals(signMethod)) {
			String stringData = coverMap2String(data);
			LogUtil.writeLog("待签名请求报文串:[" + stringData + "]");
			String strBeforeSM3 = stringData
					+ SDKConstants.AMPERSAND
					+ SecureUtil.sm3X16Str(secureKey, encoding);
			String strAfterSM3 = SecureUtil.sm3X16Str(strBeforeSM3, encoding);
			// 设置签名域值
			data.put(SDKConstants.param_signature, strAfterSM3);
			return true;
		}
		return false;
	}
765943
@Override
    public Path getFileName() {
        // Root and empty String has no file name
        if (path.length() == 0 || path.equals(ArchivePaths.root().get())) {
            return null;
        } else {
            final List<String> tokens = tokenize(this);
            // Furthest out
            final Path fileName = new ShrinkWrapPath(tokens.get(tokens.size() - 1), this.fileSystem);
            return fileName;
        }
    }
811411
@Override
    public boolean checkSign(byte[] content, byte[] data) {
        try (PooledObject<SignatureHolder> holder = CACHE.get(id).get()) {
            Signature signature = holder.get().getVerify();
            signature.update(content);
            return signature.verify(BASE_64.decrypt(data));
        } catch (Exception e) {
            throw new SecureException("加密失败", e);
        }
    }
785210
public com.google.protobuf.ByteString
      getFilenameBytes() {
    java.lang.Object ref = filename_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      filename_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
511875
final boolean hasEncryptionInfo() {
        ObjectMetadata metadata = s3obj.getObjectMetadata();
        Map<String, String> userMeta = metadata.getUserMetadata();
        return userMeta != null
            && userMeta.containsKey(Headers.CRYPTO_IV)
            && (userMeta.containsKey(Headers.CRYPTO_KEY_V2)
                || userMeta.containsKey(Headers.CRYPTO_KEY));
    }