本文整理了Java中org.xipki.util.Hex.decode()
方法的一些代码示例,展示了Hex.decode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Hex.decode()
方法的具体详情如下:
包路径:org.xipki.util.Hex
类名称:Hex
方法名:decode
暂无
代码示例来源:origin: org.xipki/security
/**
* Returns the hex representation of the bytes.
*
* @param bytes
* Data to be encoded. Must not be {@code null}.
* @return the hex representation of the bytes.
*/
protected static byte[] decodeHex(String hex) {
return Hex.decode(hex);
}
代码示例来源:origin: org.xipki/security-pkcs11
/**
* Returns the hex representation of the bytes.
*
* @param bytes
* Data to be encoded. Must not be {@code null}.
* @return the hex representation of the bytes.
*/
protected static byte[] decodeHex(String hex) {
return Hex.decode(hex);
}
代码示例来源:origin: xipki/xipki
public static byte[] decode(String hex) {
return decode(hex.toCharArray());
}
代码示例来源:origin: org.xipki/security
private static void addDigestPkcsPrefix(HashAlgo algo, String prefix) {
digestPkcsPrefix.put(algo, Hex.decode(prefix));
}
代码示例来源:origin: org.xipki/util
public static byte[] decode(String hex) {
return decode(hex.toCharArray());
}
代码示例来源:origin: org.xipki/ca-server
private static byte[] getTransactionIdBytes(String tid) throws OperationException {
byte[] bytes = null;
final int n = tid.length();
if (n % 2 != 0) { // neither hex nor base64 encoded
bytes = tid.getBytes();
} else {
try {
bytes = Hex.decode(tid);
} catch (Exception ex) {
if (n % 4 == 0) {
try {
bytes = Base64.decode(tid);
} catch (Exception ex2) {
LOG.error("could not decode (hex or base64) '{}': {}", tid, ex2.getMessage());
}
}
}
}
if (bytes == null) {
bytes = tid.getBytes();
}
if (bytes.length > 20) {
throw new OperationException(ErrorCode.BAD_REQUEST, "transactionID too long");
}
return bytes;
} // method getTransactionIdBytes
代码示例来源:origin: org.xipki/security
byte[] keyId = null;
if (str != null) {
keyId = Hex.decode(str);
代码示例来源:origin: org.xipki/security-pkcs11
byte[] keyId = null;
if (str != null) {
keyId = Hex.decode(str);
内容来源于网络,如有侵权,请联系作者删除!