本文整理汇总了Java中org.restlet.data.Digest类的典型用法代码示例。如果您正苦于以下问题:Java Digest类的具体用法?Java Digest怎么用?Java Digest使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Digest类属于org.restlet.data包,在下文中一共展示了Digest类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: digest
import org.restlet.data.Digest; //导入依赖的package包/类
/**
* If the algorithm is {@link Digest#ALGORITHM_HTTP_DIGEST}, then is
* retrieves the realm for {@link #getDigestAuthenticator()} to compute the
* digest, otherwise, it keeps the default behavior.
*/
@Override
protected char[] digest(String identifier, char[] secret, String algorithm) {
if (Digest.ALGORITHM_HTTP_DIGEST.equals(algorithm)) {
String result = DigestUtils.toHttpDigest(identifier, secret,
getDigestAuthenticator().getRealm());
if (result != null) {
return result.toCharArray();
}
return null;
}
return super.digest(identifier, secret, algorithm);
}
示例2: HttpDigestVerifier
import org.restlet.data.Digest; //导入依赖的package包/类
/**
* Constructor.
*
* @param digestAuthenticator
* The associated digest authenticator.
* @param wrappedAlgorithm
* The digest algorithm of secrets provided by the wrapped
* verifier.
* @param wrappedVerifier
* The wrapped secret verifier.
*/
public HttpDigestVerifier(DigestAuthenticator digestAuthenticator,
LocalVerifier wrappedVerifier, String wrappedAlgorithm) {
super(Digest.ALGORITHM_HTTP_DIGEST, wrappedVerifier, wrappedAlgorithm);
this.digestAuthenticator = digestAuthenticator;
}