Example usage for org.bouncycastle.pqc.math.linearalgebra ByteUtils toHexString

List of usage examples for org.bouncycastle.pqc.math.linearalgebra ByteUtils toHexString

Introduction

In this page you can find the example usage for org.bouncycastle.pqc.math.linearalgebra ByteUtils toHexString.

Prototype

public static String toHexString(byte[] input) 

Source Link

Document

Convert a byte array to the corresponding hexstring.

Usage

From source file:com.bitsofproof.btc1k.server.vault.Vault.java

License:Apache License

public RandomKey generateRandomKey() throws ValidationException {
    byte[] entropy = new byte[16];
    random.nextBytes(entropy);//  w  w  w  .ja v a  2  s.  c o  m

    return new RandomKey(BIP39.encode(entropy, ""),
            ByteUtils.toHexString(ExtendedKey.create(entropy).getKey(0).getPublic()));
}

From source file:com.bitsofproof.btc1k.server.vault.Vault.java

License:Apache License

public List<NamedKey> getKeys() {
    List<NamedKey> keys = new ArrayList<>();
    for (Map.Entry<String, ECPublicKey> e : publicKeys.entrySet()) {
        keys.add(new NamedKey(e.getKey(), ByteUtils.toHexString(e.getValue().getPublic())));
    }/* w w w  .j a  va2 s. c  om*/
    return keys;
}

From source file:org.thingsboard.server.common.msg.EncryptionUtil.java

License:Apache License

public static String getSha3Hash(String data) {
    String trimmedData = trimNewLines(data);
    byte[] dataBytes = trimmedData.getBytes();
    SHA3Digest md = new SHA3Digest(256);
    md.reset();/*from   ww w . j  a  v a  2 s. com*/
    md.update(dataBytes, 0, dataBytes.length);
    byte[] hashedBytes = new byte[256 / 8];
    md.doFinal(hashedBytes, 0);
    String sha3Hash = ByteUtils.toHexString(hashedBytes);
    return sha3Hash;
}