Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-05


oracle.security.crypto.asn1
Class ASN1BitString

java.lang.Object
  extended by oracle.security.crypto.asn1.ASN1BitString

All Implemented Interfaces:
ASN1Object, ASN1TaggedObject, Streamable

public class ASN1BitString
extends java.lang.Object
implements ASN1TaggedObject

The universal ASN.1 bit string type.

The input may be any valid BER encoding of an ASN.1 bit string. The output is always a DER encoding.


Constructor Summary
ASN1BitString()
           
ASN1BitString(java.math.BigInteger v)
          Creates a new bit string from the given integer value.
ASN1BitString(byte[] value)
           
ASN1BitString(byte[] value, int unused)
           
ASN1BitString(java.io.InputStream is)
           
ASN1BitString(int nBits)
          Creates a new ASN.1 bit string of the specified number of bits.

 

Method Summary
 int bitLength()
           
 void clearBit(int n)
          Clears the specified bit.
 ASN1Header getHeader()
           
 int getUnused()
           
 byte[] getValue()
           
 void input(java.io.InputStream is)
          Inputs this object from the specified input stream.
static byte[] inputValue(java.io.InputStream is)
           
 int intValue()
           
 int length()
          Length of this object's encoding.
 void output(java.io.OutputStream os)
          Outputs this object to the specified output stream.
static void outputValue(java.io.OutputStream os, byte[] value)
           
static void outputValueWithTag(java.io.OutputStream os, byte[] value, int tag)
           
 void setBit(int n)
          Sets the specified bit.
 boolean testBit(int n)
          Tests the specified bit.
 java.lang.String toString()
           

 

Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Constructor Detail

ASN1BitString

public ASN1BitString()

ASN1BitString

public ASN1BitString(byte[] value)

ASN1BitString

public ASN1BitString(byte[] value,
                     int unused)

ASN1BitString

public ASN1BitString(int nBits)
Creates a new ASN.1 bit string of the specified number of bits. Initially all bits are zero.

ASN1BitString

public ASN1BitString(java.math.BigInteger v)
Creates a new bit string from the given integer value.

The new bit string is obtained from the binary expansion of n, most significant bit first, not including the sign bit.


ASN1BitString

public ASN1BitString(java.io.InputStream is)
              throws java.io.IOException
Throws:
java.io.IOException

Method Detail

getHeader

public ASN1Header getHeader()
Specified by:
getHeader in interface ASN1TaggedObject

getValue

public byte[] getValue()

intValue

public int intValue()

getUnused

public int getUnused()

bitLength

public int bitLength()

testBit

public boolean testBit(int n)
Tests the specified bit.
Throws:
java.lang.ArithmeticException - If the bit index is out of bounds

setBit

public void setBit(int n)
Sets the specified bit.
Throws:
java.lang.ArithmeticException - If the bit index is out of bounds

clearBit

public void clearBit(int n)
Clears the specified bit.
Throws:
java.lang.ArithmeticException - If the bit index is out of bounds

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

input

public void input(java.io.InputStream is)
           throws java.io.IOException
Description copied from interface: Streamable
Inputs this object from the specified input stream.
Specified by:
input in interface Streamable
Throws:
java.io.IOException

inputValue

public static byte[] inputValue(java.io.InputStream is)
                         throws java.io.IOException
Throws:
java.io.IOException

output

public void output(java.io.OutputStream os)
            throws java.io.IOException
Description copied from interface: Streamable
Outputs this object to the specified output stream.
Specified by:
output in interface Streamable
Throws:
java.io.IOException

length

public int length()
Description copied from interface: Streamable
Length of this object's encoding.
Specified by:
length in interface Streamable

outputValue

public static void outputValue(java.io.OutputStream os,
                               byte[] value)
                        throws java.io.IOException
Throws:
java.io.IOException

outputValueWithTag

public static void outputValueWithTag(java.io.OutputStream os,
                                      byte[] value,
                                      int tag)
                               throws java.io.IOException
Throws:
java.io.IOException

Skip navigation links

Oracle Fusion Middleware Crypto FIPS Java API Reference for Oracle Security Developer Tools
11g Release 1 (11.1.1)

E10696-05


Copyright © 2005, 2013, Oracle. All rights reserved.