Example usage for org.bouncycastle.util.encoders HexEncoder encode

List of usage examples for org.bouncycastle.util.encoders HexEncoder encode

Introduction

In this page you can find the example usage for org.bouncycastle.util.encoders HexEncoder encode.

Prototype

public int encode(byte[] data, int off, int length, OutputStream out) throws IOException 

Source Link

Document

encode the input data producing a Hex output stream.

Usage

From source file:net.ripe.rpki.commons.crypto.util.KeyPairUtil.java

License:BSD License

static String hexEncodeHashData(byte[] keyHashData) {
    HexEncoder hexEncoder = new HexEncoder();
    ByteArrayOutputStream out = new ByteArrayOutputStream();
    try {/*  w ww .  j  av  a  2  s  . c o m*/
        hexEncoder.encode(keyHashData, 0, keyHashData.length, out);
        out.flush();
        return out.toString();
    } catch (IOException e) {
        throw new IllegalArgumentException("Exception hex encoding data", e);
    }
}