@Override public byte[] encode() { final List<DEREncoder> l = new ArrayList<>(); l.add(new OctetStringType(getSessionSourceIp())); l.add(new OctetStringType(getSessionSourceName())); l.add(new OctetStringType(getFormatOID())); l.add(new OctetStringType(getSessionTrackingIdentifier())); final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, l.toArray(new DEREncoder[l.size()])); return se.encode(); }
@Override public void handle(final DERParser parser, final ByteBuffer encoded) { decoded = OctetStringType.decode(encoded); }
@Override public byte[] encode() { return encode(derItem); }
/** * Converts bytes in the buffer to a string by reading from the current position to the limit, which assumes the bytes * of the string are in big-endian order. * * @param encoded buffer containing DER-encoded data where the buffer is positioned at the start of string bytes and * the limit is set beyond the last byte of string data. * * @return decoded bytes as an string */ public static String decode(final ByteBuffer encoded) { return new String(readBuffer(encoded), StandardCharsets.UTF_8); }
/** * Creates a new context type. * * @param index of this item in the context * @param item to encode */ public ContextType(final int index, final String item) { this(index, OctetStringType.toBytes(item)); }
/** * Converts bytes in the buffer to a string by reading from the current position to the limit, which assumes the bytes * of the string are in big-endian order. * * @param encoded buffer containing DER-encoded data where the buffer is positioned at the start of string bytes and * the limit is set beyond the last byte of string data. * * @return decoded bytes as an string */ public static String decode(final ByteBuffer encoded) { return new String(readBuffer(encoded), StandardCharsets.UTF_8); }
/** * Creates a new context type. * * @param index of this item in the context * @param item to encode */ public ContextType(final int index, final String item) { this(index, OctetStringType.toBytes(item)); }
@Override public void handle(final DERParser parser, final ByteBuffer encoded) { decoded = OctetStringType.decode(encoded); }
/** * Converts bytes in the buffer to a string by reading from the current position to the limit, which assumes the bytes * of the string are in big-endian order. * * @param encoded buffer containing DER-encoded data where the buffer is positioned at the start of string bytes and * the limit is set beyond the last byte of string data. * * @return decoded bytes as an string */ public static String decode(final ByteBuffer encoded) { return new String(readBuffer(encoded), CHARSET); }
@Override public byte[] encode() { final List<DEREncoder> l = new ArrayList<>(); l.add(new OctetStringType(getSessionSourceIp())); l.add(new OctetStringType(getSessionSourceName())); l.add(new OctetStringType(getFormatOID())); l.add(new OctetStringType(getSessionTrackingIdentifier())); final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, l.toArray(new DEREncoder[l.size()])); return se.encode(); }
/** * Creates a new context type. * * @param index of this item in the context * @param item to encode */ public ContextType(final int index, final String item) { this(index, OctetStringType.toBytes(item)); }
@Override public byte[] encode() { return encode(derItem); }
@Override public void handle(final DERParser parser, final ByteBuffer encoded) { decoded = OctetStringType.decode(encoded); }
@Override public void handle(final DERParser parser, final ByteBuffer encoded) { final byte[] cookie = OctetStringType.readBuffer(encoded); if (cookie != null && cookie.length > 0) { getObject().setCookie(cookie); } } }
@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, new IntegerType(0), new OctetStringType(serverName)); return se.encode(); } }
@Override public byte[] encode() { return getAuthorizationId() != null ? OctetStringType.toBytes(getAuthorizationId()) : EMPTY_AUTHZ; } }
@Override public byte[] encode() { return encode(derItem); }
@Override public void decode(final byte[] encoded) { setValue(OctetStringType.decode(ByteBuffer.wrap(encoded))); }
@Override public void handle(final DERParser parser, final ByteBuffer encoded) { final byte[] cookie = OctetStringType.readBuffer(encoded); if (cookie != null && cookie.length > 0) { getObject().setCookie(cookie); } } }
@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, new IntegerType(0), new OctetStringType(serverName)); return se.encode(); } }