cn.dreampie.security.sign
类 CookieSigner

java.lang.Object
  继承者 cn.dreampie.security.sign.CookieSigner
所有已实现的接口:
Signer

public class CookieSigner
extends Object
implements Signer

Default cookie signer, using HMAC-SHA1 algorithm to sign the cookie.

作者:
apeyrard

构造方法摘要
CookieSigner()
           
CookieSigner(SignatureKey signatureKey)
           
 
方法摘要
 String sign(String cookie)
          Sign the specified message.
 boolean verify(String cookie, String signedCookie)
          Verify if the specified message correspond to the signed one.
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

CookieSigner

public CookieSigner()

CookieSigner

public CookieSigner(SignatureKey signatureKey)
方法详细信息

sign

public String sign(String cookie)
从接口 Signer 复制的描述
Sign the specified message.

指定者:
接口 Signer 中的 sign
参数:
cookie - The message to sign.
返回:
The signed message.

verify

public boolean verify(String cookie,
                      String signedCookie)
从接口 Signer 复制的描述
Verify if the specified message correspond to the signed one.

指定者:
接口 Signer 中的 verify
参数:
cookie - The message to verify.
signedCookie - The signed message.
返回:
True if the message is corresponding to the signed message, false otherwise.


Copyright © 2015. All rights reserved.