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

java.lang.Object
  extended by edu.vt.middleware.crypt.x509.types.BitString
      extended by edu.vt.middleware.crypt.x509.types.ReasonFlags

public class ReasonFlags
extends BitString

Representation of the ReasonFlags type defined in section 4.2.1.14 of RFC 2459.

Version:
$Revision: 427 $
Author:
Middleware Services

Field Summary
 
Fields inherited from class edu.vt.middleware.crypt.x509.types.BitString
BITS_IN_BYTE, INT_BYTE_SIZE, octets, UNSIGNED_BYTE_MASK
 
Constructor Summary
ReasonFlags(byte[] bitString)
          Creates a new instance with the given bit string, where each bit is one of the constants defined in the Reasons enumeration.
ReasonFlags(int flags)
          Creates a new instance from OR-ing Reasons bitmask values.
ReasonFlags(Reasons[] reasons)
          Creates a new instance that has all the given Reasons bits set.
 
Method Summary
 Collection<Reasons> getReasons()
          Gets a collection of the bits set for this instance.
 String toString()
           
 
Methods inherited from class edu.vt.middleware.crypt.x509.types.BitString
equals, getBytes, getOctets, hashCode, intValue
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ReasonFlags

public ReasonFlags(byte[] bitString)
Creates a new instance with the given bit string, where each bit is one of the constants defined in the Reasons enumeration.

Parameters:
bitString - Octets making up reason flags bit string.

ReasonFlags

public ReasonFlags(int flags)
Creates a new instance from OR-ing Reasons bitmask values.

Parameters:
flags - Bit mask created by OR-ing the bitmask of Reasons enum values together, e.g. Reasons.KeyCompromise.getMask()|Reasons.CessationOfOperation.getMask()

ReasonFlags

public ReasonFlags(Reasons[] reasons)
Creates a new instance that has all the given Reasons bits set.

Parameters:
reasons - Array of Reasons describing all key usage bits to be set.
Method Detail

getReasons

public Collection<Reasons> getReasons()
Gets a collection of the bits set for this instance.

Returns:
Collection of Reasons representing the bits that are set for this instance.

toString

public String toString()
Overrides:
toString in class Object
Returns:
List of all reason bits set in this object, e.g. [KeyCompromise, CessationOfOperation].


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