edu.vt.middleware.crypt.x509.types
Class BitString

java.lang.Object
  extended by edu.vt.middleware.crypt.x509.types.BitString
Direct Known Subclasses:
KeyUsage, ReasonFlags

public class BitString
extends Object

Represents a string of bits encoded into octets in network byte order.

Version:
$Revision: 2745 $
Author:
Middleware Services

Field Summary
protected static int BITS_IN_BYTE
          Number of bits in a byte.
protected static int INT_BYTE_SIZE
          Number of bytes in a Java int.
protected  byte[] octets
          Octets used to encode bit string.
protected static int UNSIGNED_BYTE_MASK
          Unsigned byte bitmask.
 
Constructor Summary
BitString()
           
 
Method Summary
 boolean equals(Object obj)
          
static byte[] getBytes(int bitString)
          Gets a byte representation of a bit string encoded as a Java integer.
 byte[] getOctets()
           
 int hashCode()
          
 int intValue()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INT_BYTE_SIZE

protected static final int INT_BYTE_SIZE
Number of bytes in a Java int.

See Also:
Constant Field Values

BITS_IN_BYTE

protected static final int BITS_IN_BYTE
Number of bits in a byte.

See Also:
Constant Field Values

UNSIGNED_BYTE_MASK

protected static final int UNSIGNED_BYTE_MASK
Unsigned byte bitmask.

See Also:
Constant Field Values

octets

protected byte[] octets
Octets used to encode bit string.

Constructor Detail

BitString

public BitString()
Method Detail

getBytes

public static byte[] getBytes(int bitString)
Gets a byte representation of a bit string encoded as a Java integer.

Parameters:
bitString - Bit string stored in Java int.
Returns:
Bit string encoded as octets.

getOctets

public byte[] getOctets()
Returns:
Bit string encoded as octet bytes.

intValue

public int intValue()
Returns:
The value of the bit string as a Java int.

equals

public boolean equals(Object obj)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object


Copyright © 2003-2013 Virginia Tech. All Rights Reserved.