public class DERWriter
extends java.io.FilterOutputStream
Modifier and Type | Field and Description |
---|---|
private byte[] |
lenBytes |
Constructor and Description |
---|
DERWriter() |
DERWriter(int initialSize) |
DERWriter(java.io.OutputStream stream) |
Modifier and Type | Method and Description |
---|---|
private boolean |
isPositive(byte b) |
DERWriter |
startSequence() |
byte[] |
toByteArray() |
void |
writeBigInteger(java.math.BigInteger value) |
void |
writeBigInteger(byte... bytes)
The integer is always considered to be positive, so if the first byte is < 0,
we pad with a zero to make it positive
|
void |
writeBigInteger(byte[] bytes,
int off,
int len)
The integer is always considered to be positive, so if the first byte is < 0,
we pad with a zero to make it positive
|
void |
writeLength(int len) |
void |
writeObject(ASN1Object obj) |
void |
writeObject(byte tag,
int len,
byte... data) |
public DERWriter()
public DERWriter(int initialSize)
public DERWriter(java.io.OutputStream stream)
public DERWriter startSequence()
public void writeBigInteger(java.math.BigInteger value) throws java.io.IOException
java.io.IOException
public void writeBigInteger(byte... bytes) throws java.io.IOException
bytes
- BigInteger
bytesjava.io.IOException
- If failed to write the bytespublic void writeBigInteger(byte[] bytes, int off, int len) throws java.io.IOException
bytes
- BigInteger
bytesoff
- Offset in bytes datalen
- Number of bytes to writejava.io.IOException
- If failed to write the bytesprivate boolean isPositive(byte b)
public void writeObject(ASN1Object obj) throws java.io.IOException
java.io.IOException
public void writeObject(byte tag, int len, byte... data) throws java.io.IOException
java.io.IOException
public void writeLength(int len) throws java.io.IOException
java.io.IOException
public byte[] toByteArray() throws java.io.IOException
java.io.IOException