/** * Creates a new octet string type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public OctetStringType(final DERTag tag, final byte[] item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = item; }
/** * Creates a new octet string type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public OctetStringType(final DERTag tag, final byte[] item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = item; }
/** * Creates a new octet string type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public OctetStringType(final DERTag tag, final byte[] item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = item; }
/** * Creates a new integer type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public IntegerType(final DERTag tag, final BigInteger item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = item.toByteArray(); }
/** * Creates a new sequence encoder. * * @param tag der tag associated with this type * @param encoders to encode in this sequence */ public ConstructedDEREncoder(final DERTag tag, final DEREncoder... encoders) { super(tag); if (!tag.isConstructed()) { throw new IllegalArgumentException("DER tag must be constructed"); } if (encoders == null || encoders.length == 0) { throw new IllegalArgumentException("Encoders cannot be null or empty"); } derEncoders = encoders; }
/** * Creates a new integer type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public IntegerType(final DERTag tag, final BigInteger item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = item.toByteArray(); }
/** * Creates a new integer type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public IntegerType(final DERTag tag, final int item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = BigInteger.valueOf(item).toByteArray(); }
/** * Creates a new sequence encoder. * * @param tag der tag associated with this type * @param encoders to encode in this sequence */ public ConstructedDEREncoder(final DERTag tag, final DEREncoder... encoders) { super(tag); if (!tag.isConstructed()) { throw new IllegalArgumentException("DER tag must be constructed"); } if (encoders == null || encoders.length == 0) { throw new IllegalArgumentException("Encoders cannot be null or empty"); } derEncoders = encoders; }
/** * Creates a new integer type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public IntegerType(final DERTag tag, final int item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = BigInteger.valueOf(item).toByteArray(); }
/** * Creates a new integer type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public IntegerType(final DERTag tag, final int item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = BigInteger.valueOf(item).toByteArray(); }
/** * Creates a new oid type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public OidType(final DERTag tag, final int[] item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(item); }
/** * Creates a new boolean type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public BooleanType(final DERTag tag, final boolean item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(item); }
/** * Creates a new uuid type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public UuidType(final DERTag tag, final UUID item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(item); }
/** * Creates a new oid type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public OidType(final DERTag tag, final int[] item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(item); }
/** * Creates a new boolean type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public BooleanType(final DERTag tag, final boolean item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(item); }
/** * Creates a new uuid type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public UuidType(final DERTag tag, final UUID item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(item); }
/** * Creates a new boolean type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public BooleanType(final DERTag tag, final boolean item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(item); }
/** * Creates a new oid type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public OidType(final DERTag tag, final String item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(parse(item)); }
/** * Creates a new oid type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public OidType(final DERTag tag, final String item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(parse(item)); }
/** * Creates a new oid type. * * @param tag der tag associated with this type * @param item to DER encode * * @throws IllegalArgumentException if the der tag is constructed */ public OidType(final DERTag tag, final String item) { super(tag); if (tag.isConstructed()) { throw new IllegalArgumentException("DER tag must not be constructed"); } derItem = toBytes(parse(item)); }