org.openid4java.association.Association.createHmacSha256()方法的使用及代码示例

x33g5p2x  于2022-01-17 转载在 其他  
字(5.0k)|赞(0)|评价(0)|浏览(93)

本文整理了Java中org.openid4java.association.Association.createHmacSha256()方法的一些代码示例,展示了Association.createHmacSha256()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Association.createHmacSha256()方法的具体详情如下:
包路径:org.openid4java.association.Association
类名称:Association
方法名:createHmacSha256

Association.createHmacSha256介绍

暂无

代码示例

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provider

@Override
  public Association load(String handle) {

    if(IdentityUtil.isBlank(handle)){
      throw new IllegalArgumentException("Handle is empty");
    }
    if(log.isDebugEnabled()){
      log.debug("Inside load(); handle : " + handle);
    }
    String timeStamp = handle.substring((Integer.toString(storeId)).length(), handle.indexOf("-"));
    Date expireDate = new Date(Long.parseLong(timeStamp)+ this.expireIn);
    if(log.isDebugEnabled()){
      log.debug("Calculated Expiry Time : " + expireDate.getTime());
    }
//        SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
//        PBEKeySpec spec = new PBEKeySpec(serverKey.toCharArray(), handle.getBytes(), 1, 256);
//        SecretKey secretKey = factory.generateSecret(spec);

    return Association.createHmacSha256(handle, (serverKey + handle).getBytes(), expireDate);
  }

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.openid/org.wso2.carbon.identity.provider

@Override
  public Association load(String handle) {

    if(IdentityUtil.isBlank(handle)){
      throw new IllegalArgumentException("Handle is empty");
    }
    if(log.isDebugEnabled()){
      log.debug("Inside load(); handle : " + handle);
    }
    String timeStamp = handle.substring((Integer.toString(storeId)).length(), handle.indexOf("-"));
    Date expireDate = new Date(Long.parseLong(timeStamp)+ this.expireIn);
    if(log.isDebugEnabled()){
      log.debug("Calculated Expiry Time : " + expireDate.getTime());
    }
//        SecretKeyFactory factory = SecretKeyFactory.getInstance("PBKDF2WithHmacSHA1");
//        PBEKeySpec spec = new PBEKeySpec(serverKey.toCharArray(), handle.getBytes(), 1, 256);
//        SecretKey secretKey = factory.generateSecret(spec);

    return Association.createHmacSha256(handle, (serverKey + handle).getBytes(), expireDate);
  }

代码示例来源:origin: org.wso2.carbon.identity/org.wso2.carbon.identity.provider

Association association = Association.createHmacSha256(handle, (serverKey + handle).getBytes(), expireDate);
OpenIDServerManager.setThreadLocalAssociation(association);
return association;

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.openid/org.wso2.carbon.identity.provider

Association association = Association.createHmacSha256(handle, (serverKey + handle).getBytes(), expireDate);
OpenIDServerManager.setThreadLocalAssociation(association);
return association;

代码示例来源:origin: be.fedict.eid-idp/eid-idp-protocol-openid

long exp = dataInputStream.readLong();
  Date expDate = new Date(exp);
  return Association.createHmacSha256(handle, macKeyBytes, expDate);
} else {
  return null;

代码示例来源:origin: org.wso2.carbon.identity.inbound.auth.openid/org.wso2.carbon.identity.provider

assoc = Association.createHmacSha256(assocHandle, Base64.decode(macKey), expireIn);

代码示例来源:origin: be.fedict.eid-idp/eid-idp-protocol-openid

return Association.createHmacSha1(handle, macKeyBytes, expiry);
} else if (type == Association.TYPE_HMAC_SHA256) {
  return Association.createHmacSha256(handle, macKeyBytes, expiry);

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

Base64.decodeBase64(macKey.getBytes()), expDate);
} else if (Association.TYPE_HMAC_SHA256.equals(type)) {
  assoc = Association.createHmacSha256(handle,
                     Base64.decodeBase64(macKey.getBytes()), expDate);
} else {

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

assoc = Association.createHmacSha256(handle,
                   Base64.decodeBase64(macKey.getBytes()),
                   expDate);

代码示例来源:origin: org.openid4java/openid4java-nodeps

assoc = Association.createHmacSha256(handle,
    Base64.decodeBase64(macKey.getBytes() ), expDate);

代码示例来源:origin: com.cloudbees/openid4java-shaded

assoc = Association.createHmacSha256 (	handle,
                    Base64.decodeBase64 ( macKey.getBytes ( ) ),
                    expDate ) ;

代码示例来源:origin: jbufu/openid4java

assoc = Association.createHmacSha256(handle,
    Base64.decodeBase64(macKey.getBytes() ), expDate);

代码示例来源:origin: org.openid4java/openid4java-nodeps

assoc = Association.createHmacSha256 (	handle,
                    Base64.decodeBase64 ( macKey.getBytes ( ) ),
                    expDate ) ;

代码示例来源:origin: org.wso2.org.openid4java/openid4java-nodeps

expDate);
} else if (Association.TYPE_HMAC_SHA256.equals(type)) {
  assoc = Association.createHmacSha256(handle,
                     Base64.decodeBase64(macKey.getBytes()),
                     expDate);

代码示例来源:origin: jbufu/openid4java

assoc = Association.createHmacSha256 (	handle,
                    Base64.decodeBase64 ( macKey.getBytes ( ) ),
                    expDate ) ;

代码示例来源:origin: com.cloudbees/openid4java-shaded

assoc = Association.createHmacSha256(handle,
    Base64.decodeBase64(macKey.getBytes() ), expDate);

代码示例来源:origin: org.openid4java/openid4java

assoc = Association.createHmacSha256(handle, macKey, expiresIn);

代码示例来源:origin: org.openid4java/openid4java-nodeps

assoc = Association.createHmacSha256(handle, macKey, expiresIn);

代码示例来源:origin: com.cloudbees/openid4java-shaded

assoc = Association.createHmacSha256(handle, macKey, expiresIn);

代码示例来源:origin: jbufu/openid4java

assoc = Association.createHmacSha256(handle, macKey, expiresIn);

相关文章