@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, new IntegerType(0), new OctetStringType(serverName)); return se.encode(); } }
/** * See {@link #registerHandler(DERPath, ParseHandler)}. * * @param path to register * @param handler to associate with the path */ public void registerHandler(final String path, final ParseHandler handler) { registerHandler(new DERPath(path), handler); }
/** * Converts bytes in the buffer to a DN by reading from the current position to the limit. * * @param encoded buffer containing DER-encoded data where the buffer is positioned at the tag of the DN and the * limit is set beyond the last byte of DN data. * * @return decoded bytes as a DN */ public static DN decode(final ByteBuffer encoded) { return new DN(RDN.decode(encoded)); }
/** * Creates a new oid type. * * @param item to DER encode */ public OidType(final int[] item) { super(UniversalDERTag.OID); derItem = toBytes(item); }
/** * Creates a new context type. * * @param index of this item in the context * @param item to encode */ public ContextType(final int index, final BigInteger item) { this(index, IntegerType.toBytes(item)); }
/** * Parse a DER-encoded data structure by calling registered handlers when points of interest are encountered in the * parse tree. * * @param encoded DER-encoded bytes. */ public void parse(final ByteBuffer encoded) { parseTags(encoded); }
/** * Creates a new attribute value assertion. * * @param oid describing the attribute value * @param value of the attribute */ public AttributeValueAssertion(final String oid, final Value value) { super(value.getTag()); attributeOid = oid; attributeValue = value; }
/** * Creates a new context type. * * @param index of this item in the context * @param item to encode */ public ContextType(final int index, final byte[] item) { super(new ContextDERTag(index, false)); derItem = item; }
@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, new IntegerType(0), new OctetStringType(serverName)); return se.encode(); } }
/** * See {@link #registerHandler(DERPath, ParseHandler)}. * * @param path to register * @param handler to associate with the path */ public void registerHandler(final String path, final ParseHandler handler) { registerHandler(new DERPath(path), handler); }
/** * Converts bytes in the buffer to a DN by reading from the current position to the limit. * * @param encoded buffer containing DER-encoded data where the buffer is positioned at the tag of the DN and the * limit is set beyond the last byte of DN data. * * @return decoded bytes as a DN */ public static DN decode(final ByteBuffer encoded) { return new DN(RDN.decode(encoded)); }
@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, new IntegerType(0), new OctetStringType(serverName)); return se.encode(); } }
/** * See {@link #registerHandler(DERPath, ParseHandler)}. * * @param path to register * @param handler to associate with the path */ public void registerHandler(final String path, final ParseHandler handler) { registerHandler(new DERPath(path), handler); }
/** * Converts bytes in the buffer to a DN by reading from the current position to the limit. * * @param encoded buffer containing DER-encoded data where the buffer is positioned at the tag of the DN and the * limit is set beyond the last byte of DN data. * * @return decoded bytes as a DN */ public static DN decode(final ByteBuffer encoded) { return new DN(RDN.decode(encoded)); }
@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, new IntegerType(getSize()), new OctetStringType(getCookie() != null ? getCookie() : EMPTY_COOKIE)); return se.encode(); }
@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, new IntegerType(getSize()), new OctetStringType(getCookie() != null ? getCookie() : EMPTY_COOKIE)); return se.encode(); }
@Override public byte[] encode() { final ConstructedDEREncoder se = new ConstructedDEREncoder( UniversalDERTag.SEQ, new IntegerType(getSize()), new OctetStringType(getCookie() != null ? getCookie() : EMPTY_COOKIE)); return se.encode(); }