生成签名
@return 签名，本函数不覆盖sign成员变量，如要设置签名需要调用SetSign方法赋值
354408
public function makeSign()
    {
        //签名步骤一：按字典序排序参数
        ksort($this->values);
        $string = $this->ToUrlParams();
        //签名步骤二：在string后加入KEY
        $string = $string . "&key=".Config::getKEY();
        //签名步骤三：MD5加密
        $string = md5($string);
        //签名步骤四：所有字符转为大写
        $result = strtoupper($string);
        return $result;
    }
163523
public function createSign($data, $private_key_path)
    {
        $priKey = file_get_contents($private_key_path);
        $res = openssl_get_privatekey($priKey);
        openssl_sign($data, $sign, $res);
        openssl_free_key($res);
        //base64编码
        $sign = base64_encode($sign);
        return $sign;
    }
667312
public function MakeSign()
    {
        //签名步骤一：按字典序排序参数
        ksort($this->values);
        $string = $this->ToUrlParams();
        //签名步骤二：在string后加入KEY
        $string = $string . "&key=" . $this->key;
        if ($this->IsSign_typeSet() && $this->GetSign_type() == 'HMAC-SHA256') {
            //签名步骤三：HMAC-SHA256加密
            $string = hash_hmac('sha256', $string, $this->key);
        } else {
            //签名步骤三：MD5加密
            $string = md5($string);
        }
        //签名步骤四：所有字符转为大写
        $result = strtoupper($string);
        return $result;
    }
974279
public static BinaryTypeSignature createTypeSignature(String signature) {
//		if (!isSignature(signature)) {
//			throw new IllegalArgumentException(signature);
//		}
		if (signature.charAt(signature.length() - 1) != ';')
			return new BinaryTypeSignature(signature);
		return new BinaryGenericTypeSignature(signature);
	}
173804
public String getSignature() {
        final StringBuilder builder = new StringBuilder("(");
        parameters.forEach(builder::append);
        return builder.append(')').append(returnType).toString();
    }
420038
public static String generateJNISignature(Class<?>[] params) {
        StringBuilder ret = new StringBuilder();

        for (Class<?> param : params) {
            ret.append(getJavaSignature(param));
        }

        return ret.toString();
    }
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;
    }
989365
public function sign()
	{
		$type = Input::get('type');
		$input = Input::get('input');
		$termId = $input['term'];
		$term = Terminal::find($termId);

		$input = Type::clearInput($type, $input);
		Secure::sign($input, $type, $term->secret);

		return $input['sign'];

	}
77983
def get_plaintext_to_sign(self):
        
        as_strings = self.pack_subdomain()
        if self.sig is not None:
            # don't sign the signature
            as_strings = as_strings[:-1]

        return ",".join(as_strings)
241145
def sign(jwk, jws = nil, header = nil)
      plain_text = to_binary
      if jws.nil?
        jwk = JOSE::JWK.from(jwk)
        jws = jwk.signer
      end
      jws = JOSE::JWS.from(jws).to_map
      if not jws.has_key?('typ')
        jws = jws.put('typ', 'JWT')
      end
      return JOSE::JWK.sign(plain_text, jws, jwk, header)
    end
1196847
@Override
	public String getName()
	{
		StringBuilder result = new StringBuilder();
		String prefix = "";

		for (IPOContext ctxt : this)
		{
			String name = ctxt.getName();

			if (name.length() > 0)
			{
				result.append(prefix);
				result.append(name);
				prefix = ", ";
			}
		}

		return result.toString();
	}
528283
private String generateSafeMethodName(StorableInfo info, String prefix) {
        Class type = info.getStorableType();

        // Try a few times to generate a unique name. There's nothing special
        // about choosing 100 as the limit.
        int value = 0;
        for (int i = 0; i < 100; i++) {
            String name = prefix + value;
            if (!methodExists(type, name)) {
                return name;
            }
            value = name.hashCode();
        }

        throw new InternalError("Unable to create unique method name starting with: "
                + prefix);
    }
505729
public synchronized String getSignature(long nonce) {
    return HexEncoder.encode(sha256HMAC.doFinal(buildSignatureData(nonce)))
        .toLowerCase(Locale.ROOT);
  }
93914
public static String generateCustomName() {
        Random random = new Random();
        StringBuilder sb = new StringBuilder();
        sb.append(PropertyConverter.getCurrentTimeSeconds());
        sb.append('_');
        int i = random.nextInt(99999);
        if (i < 10) {
            sb.append("0000");
        } else if (i < 100) {
            sb.append("000");
        } else if (i < 1000) {
            sb.append("00");
        } else if (i < 10000) {
            sb.append('0');
        }
        sb.append(i);
        return sb.toString();
    }
1058198
public static String getMethodSignature(String name, String rawSignature) {
        StringBuilder signature = new StringBuilder();
        String returnType = org.objectweb.asm.Type.getReturnType(rawSignature).getClassName();
        if (returnType != null) {
            signature.append(returnType);
            signature.append(' ');
        }
        signature.append(name);
        signature.append('(');
        org.objectweb.asm.Type[] types = org.objectweb.asm.Type.getArgumentTypes(rawSignature);
        for (int i = 0; i < types.length; i++) {
            if (i > 0) {
                signature.append(',');
            }
            signature.append(types[i].getClassName());
        }
        signature.append(')');
        return signature.toString();
    }
123778
protected String getSigningKey() {
        if (extendedMetadata != null && extendedMetadata.getSigningKey() != null) {
            return extendedMetadata.getSigningKey();
        } else {
            return keyManager.getDefaultCredentialName();
        }
    }
1247692
private function signature()
	{
		$nonce = $this->getRand();
		$timestamp = (string)time();
		$token = $this->_config['token'];
		// encrypt
		$signature = $this->getSign($nonce,$timestamp,$token);
		return '?signature='.$signature.'&nonce='.$nonce.'&timestamp='.$timestamp;
	}