org.apache.shiro.crypto.hash.Hash.toBase64()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(3.0k)|赞(0)|评价(0)|浏览(257)

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

Hash.toBase64介绍

暂无

代码示例

代码示例来源:origin: apache/shiro

/**
   * Returns {@code hash != null ? hash.toBase64() : null}.
   *
   * @param hash the hash instance to format into a String.
   * @return {@code hash != null ? hash.toBase64() : null}.
   */
  public String format(Hash hash) {
    return hash != null ? hash.toBase64() : null;
  }
}

代码示例来源:origin: apache/shiro

public String format(Hash hash) {
  if (hash == null) {
    return null;
  }
  String algorithmName = hash.getAlgorithmName();
  ByteSource salt = hash.getSalt();
  int iterations = hash.getIterations();
  StringBuilder sb = new StringBuilder(MCF_PREFIX).append(algorithmName).append(TOKEN_DELIMITER).append(iterations).append(TOKEN_DELIMITER);
  if (salt != null) {
    sb.append(salt.toBase64());
  }
  sb.append(TOKEN_DELIMITER);
  sb.append(hash.toBase64());
  return sb.toString();
}

代码示例来源:origin: apache/shiro

String hashed = hex ? hash.toHex() : hash.toBase64();
System.out.print(hex ? "Hex: " : "Base64: ");
System.out.println(hashed);

代码示例来源:origin: magefree/mage

public AuthorizedUser(String name, Hash hash, String email) {
  this.name = name;
  this.password = hash.toBase64();
  this.salt = hash.getSalt().toBase64();
  this.hashAlgorithm = hash.getAlgorithmName();
  this.hashIterations = hash.getIterations();
  this.email = email;
  this.chatLockedUntil = null;
  this.active = true;
  this.lockedUntil = null;
}

代码示例来源:origin: org.apache.shiro/shiro-crypto-hash

/**
   * Returns {@code hash != null ? hash.toBase64() : null}.
   *
   * @param hash the hash instance to format into a String.
   * @return {@code hash != null ? hash.toBase64() : null}.
   */
  public String format(Hash hash) {
    return hash != null ? hash.toBase64() : null;
  }
}

代码示例来源:origin: org.apache.shiro/shiro-crypto-hash

public String format(Hash hash) {
  if (hash == null) {
    return null;
  }
  String algorithmName = hash.getAlgorithmName();
  ByteSource salt = hash.getSalt();
  int iterations = hash.getIterations();
  StringBuilder sb = new StringBuilder(MCF_PREFIX).append(algorithmName).append(TOKEN_DELIMITER).append(iterations).append(TOKEN_DELIMITER);
  if (salt != null) {
    sb.append(salt.toBase64());
  }
  sb.append(TOKEN_DELIMITER);
  sb.append(hash.toBase64());
  return sb.toString();
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.shiro

String hashed = hex ? hash.toHex() : hash.toBase64();
System.out.print(hex ? "Hex: " : "Base64: ");
System.out.println(hashed);

代码示例来源:origin: org.apache.shiro/shiro-crypto-hash

String hashed = hex ? hash.toHex() : hash.toBase64();
System.out.print(hex ? "Hex: " : "Base64: ");
System.out.println(hashed);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.shiro

String hashed = hex ? hash.toHex() : hash.toBase64();
System.out.print(hex ? "Hex: " : "Base64: ");
System.out.println(hashed);

代码示例来源:origin: apache/ofbiz-framework

@Override
protected String getHashedKeyName(String originalKeyName) {
  HashRequest hashRequest = new HashRequest.Builder().setSource(originalKeyName).build();
  return hashService.computeHash(hashRequest).toBase64();
}

相关文章