当前位置: 首页>>代码示例>>Java>>正文


Java Algorithm.equals方法代码示例

本文整理汇总了Java中com.auth0.jwt.algorithms.Algorithm.equals方法的典型用法代码示例。如果您正苦于以下问题:Java Algorithm.equals方法的具体用法?Java Algorithm.equals怎么用?Java Algorithm.equals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.auth0.jwt.algorithms.Algorithm的用法示例。


在下文中一共展示了Algorithm.equals方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: sign

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
/**
 * Creates a new JWT and signs it with the given algorithm.
 *
 * @param algorithm used to sign the JWT
 * @return a new JWT token
 * @throws IllegalAccessException   if the developer didn't want NONE algorithm to be allowed and it was passed in
 * @throws IllegalArgumentException if the provided algorithm is null.
 * @throws JWTCreationException     if the claims could not be converted to a valid JSON or there was a problem with the signing key.
 */
public String sign(Algorithm algorithm) throws Exception {
    if(!jwt.getIsNoneAlgorithmAllowed() && algorithm.equals(Algorithm.none())) {
        throw new IllegalAccessException("None algorithm isn't allowed");
    }
    String JWS = jwt.sign(algorithm);
    verifyClaims();
    return JWS;
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:18,代码来源:ExtendedJwtCreator.java

示例2: signBase16Encoding

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
/**
 * Creates a new JWT and signs it with the given algorithm.
 *
 * @param algorithm used to sign the JWT
 * @return a new JWT token
 * @throws IllegalAccessException   if the developer didn't want NONE algorithm to be allowed and it was passed in
 * @throws IllegalArgumentException if the provided algorithm is null.
 * @throws JWTCreationException     if the claims could not be converted to a valid JSON or there was a problem with the signing key.
 */
public String signBase16Encoding(Algorithm algorithm) throws Exception {
    if(!jwt.getIsNoneAlgorithmAllowed() && algorithm.equals(Algorithm.none())) {
        throw new IllegalAccessException("None algorithm isn't allowed");
    }
    String JWS = jwt.sign(algorithm, EncodeType.Base16);
    verifyClaims();
    return JWS;
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:18,代码来源:ExtendedJwtCreator.java

示例3: signBase32Encoding

import com.auth0.jwt.algorithms.Algorithm; //导入方法依赖的package包/类
/**
 * Creates a new JWT and signs it with the given algorithm.
 *
 * @param algorithm used to sign the JWT
 * @return a new JWT token
 * @throws IllegalAccessException   if the developer didn't want NONE algorithm to be allowed and it was passed in
 * @throws IllegalArgumentException if the provided algorithm is null.
 * @throws JWTCreationException     if the claims could not be converted to a valid JSON or there was a problem with the signing key.
 */
public String signBase32Encoding(Algorithm algorithm) throws Exception {
    if(!jwt.getIsNoneAlgorithmAllowed() && algorithm.equals(Algorithm.none())) {
        throw new IllegalAccessException("None algorithm isn't allowed");
    }
    String JWS = jwt.sign(algorithm, EncodeType.Base32);
    verifyClaims();
    return JWS;
}
 
开发者ID:GJWT,项目名称:javaOIDCMsg,代码行数:18,代码来源:ExtendedJwtCreator.java


注:本文中的com.auth0.jwt.algorithms.Algorithm.equals方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。