// Copyright 1997 The Open Group Research Institute.  All rights reserved.

package krb5.lib;

import krb5.lib.asn1.*;

/**
 * Provides the KDC options
 */
public class KDCOptions extends BitString {

	/**
	 * Class constructor
	 */
	public KDCOptions() {
		super(Krb5.KDC_OPTS_MAX + 1);
	}

	/**
	 * Class constructor specifying a bit
	 *
	 * @param oneBit is of type int
	 * @exception BitStringException an exception
	 * @see krb5.lib.BitStringException
	 */
	public KDCOptions(int oneBit) throws BitStringException {
		super(Krb5.KDC_OPTS_MAX + 1);
		set(oneBit);
	}

	/**
	 * Class constructor specifying a bit array with size
	 *
	 * @param data is of type byte[]
	 * @param size is of type int
	 * @exception BitStringException an exception
	 */
	public KDCOptions(byte[] data, int size) throws BitStringException {
		super(data, size);
		if (size != Krb5.KDC_OPTS_MAX + 1)
			throw new BitStringException(Krb5.BITSTRING_BAD_LENGTH);
	}

	/**
	 * Class constructor specifying an encoding reference
	 *
	 * @param ref is of type EncodeRef
	 * @exception Asn1Exception an exception
	 * @see krb5.lib.asn1.EncodeRef
	 * @see krb5.lib.Asn1Exception
	 */
	public KDCOptions(EncodeRef ref) throws Asn1Exception,
		BitStringException {
		super(ref);
		if (size() != Krb5.KDC_OPTS_MAX + 1)
			throw new BitStringException(Krb5.BITSTRING_BAD_LENGTH);
	}

}
