use of org.eclipse.scout.rt.platform.util.HexUtility.HexOutputStream in project scout.rt by eclipse.
the class DefaultAuthToken method createUnsignedData.
protected byte[] createUnsignedData() {
try (ByteArrayOutputStream bytes = new ByteArrayOutputStream();
HexOutputStream hex = new HexOutputStream(bytes)) {
hex.write(m_userId.getBytes(StandardCharsets.UTF_8));
bytes.write(partsDelimiter());
bytes.write(Long.toHexString(m_validUntil).getBytes());
if (m_customArgs != null) {
for (String arg : m_customArgs) {
bytes.write(partsDelimiter());
hex.write(arg.getBytes(StandardCharsets.UTF_8));
}
}
return bytes.toByteArray();
} catch (IOException ex) {
throw new PlatformException("unexpected behaviour", ex);
}
}
Aggregations