本文整理汇总了Java中org.bouncycastle.util.encoders.Hex.toHexString方法的典型用法代码示例。如果您正苦于以下问题:Java Hex.toHexString方法的具体用法?Java Hex.toHexString怎么用?Java Hex.toHexString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bouncycastle.util.encoders.Hex
的用法示例。
在下文中一共展示了Hex.toHexString方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deletePkcs11Entry
import org.bouncycastle.util.encoders.Hex; //导入方法依赖的package包/类
private static boolean deletePkcs11Entry(File dir, byte[] objectId) {
String hextId = Hex.toHexString(objectId);
File infoFile = new File(dir, hextId + INFO_FILE_SUFFIX);
boolean b1 = true;
if (infoFile.exists()) {
b1 = infoFile.delete();
}
File valueFile = new File(dir, hextId + VALUE_FILE_SUFFIX);
boolean b2 = true;
if (valueFile.exists()) {
b2 = valueFile.delete();
}
return b1 || b2;
}
示例2: getNumber
import org.bouncycastle.util.encoders.Hex; //导入方法依赖的package包/类
private String getNumber(Number no) {
if (!hex) {
return no.toString();
}
if (no instanceof Byte) {
return "0X" + Hex.toHexString(new byte[]{(byte) no});
} else if (no instanceof Short) {
return "0X" + Integer.toHexString(Integer.valueOf((short) no));
} else if (no instanceof Integer) {
return "0X" + Integer.toHexString((int) no);
} else if (no instanceof Long) {
return "0X" + Long.toHexString((long) no);
} else if (no instanceof Long) {
return "0X" + Long.toHexString((long) no);
} else if (no instanceof BigInteger) {
return "0X" + ((BigInteger) no).toString(16);
} else {
return no.toString();
}
}
示例3: sha3
import org.bouncycastle.util.encoders.Hex; //导入方法依赖的package包/类
public static String sha3(String key) {
DigestKeccak md = new DigestKeccak(512);
try {
md.update(key.getBytes("UTF-8"));
}catch (UnsupportedEncodingException e) {
e.printStackTrace();
}
byte[] digest=md.digest();
return Hex.toHexString(digest);
}
示例4: EncryptPass
import org.bouncycastle.util.encoders.Hex; //导入方法依赖的package包/类
public String EncryptPass(String strPass) {
MessageDigest md5 = null;
try {
md5 = MessageDigest.getInstance("MD5");
} catch (Exception e) {
e.printStackTrace();
return "";
}
byte[] md5md5Bytes = md5.digest(strPass.getBytes());
return Hex.toHexString(md5md5Bytes);
}
示例5: getChecksumSHA3
import org.bouncycastle.util.encoders.Hex; //导入方法依赖的package包/类
public String getChecksumSHA3(Path path) throws IOException, DigestException, NoSuchAlgorithmException {
return Hex.toHexString(setChecksumSHA3(path));
}
示例6: AESSensitivePropertyProvider
import org.bouncycastle.util.encoders.Hex; //导入方法依赖的package包/类
public AESSensitivePropertyProvider(byte[] key) throws NoSuchPaddingException, NoSuchAlgorithmException, NoSuchProviderException {
this(key == null ? "" : Hex.toHexString(key));
}