/*
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied.  See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */
package com.fanmei.pay4j.sign;

import javax.annotation.Nonnull;
import java.nio.charset.Charset;

/**
 * 签名
 */
public interface Signature {

    /**
     * 签名
     *
     * @param obj
     * @return
     */
    String sign(@Nonnull Object obj, @Nonnull Charset charset, boolean encode);

    /**
     * UTF-8签名
     */
    String sign(@Nonnull Object obj, boolean encode);

    /**
     * UTF-8签名&不编码
     */
    String sign(@Nonnull Object obj);

    /**
     * UTF-8签名&编码
     */
    String signWithEncode(@Nonnull Object obj);

    /**
     * 验证签名是否一致
     * @param obj
     * @param sign
     * @return
     */
    boolean isValidSign(@Nonnull Object obj, @Nonnull String sign);
}

@@ -978,32 +978,89 @@
     * @param obj
+ %E7%AD%BE%E5%90%8D%E5%AF%B9%E8%B1%A1%0A     * @param charset %E5%AD%97%E7%AC%A6%E9%9B%86%0A     * @param encode %E6%98%AF%E5%90%A6%E7%BC%96%E7%A0%81
 %0A     * @return%0A
@@ -1050,32 +1050,35 @@
 %E7%A0%81%0A     * @return
+ %E7%AD%BE%E5%90%8D
 %0A     */%0A    Str
@@ -1174,16 +1174,88 @@
 UTF-8%E7%AD%BE%E5%90%8D%0A
+     * @param obj %E7%AD%BE%E5%90%8D%E5%AF%B9%E8%B1%A1%0A     * @param encode %E6%98%AF%E5%90%A6%E7%BC%96%E7%A0%81%0A     * @return UTF-8%E7%AD%BE%E5%90%8D%0A
      */%0A
@@ -1335,13 +1335,53 @@
 -8%E7%AD%BE%E5%90%8D
-&
 %E4%B8%8D%E7%BC%96%E7%A0%81%0A
+     * @param obj %E7%AD%BE%E5%90%8D%E5%AF%B9%E8%B1%A1%0A     * @return %E7%AD%BE%E5%90%8D%0A
     
@@ -1449,12 +1449,52 @@
 -8%E7%AD%BE%E5%90%8D
-&
 %E7%BC%96%E7%A0%81%0A
+     * @param obj %E7%AD%BE%E5%90%8D%E5%AF%B9%E8%B1%A1%0A     * @return %E7%AD%BE%E5%90%8D%0A
     
@@ -1587,16 +1587,21 @@
 aram obj
+ %E7%AD%BE%E5%90%8D%E5%AF%B9%E8%B1%A1
 %0A     * 
@@ -1611,16 +1611,19 @@
 ram sign
+ %E7%AD%BE%E5%90%8D
 %0A     * 
@@ -1629,16 +1629,23 @@
  @return
+ %E7%AD%BE%E5%90%8D%E6%98%AF%E5%90%A6%E4%B8%80%E8%87%B4
 %0A     */

fix javadoc