本文整理匯總了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));
}