/**
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: DerInputBuffer.java,v 1.2 2008/06/25 05:52:44 qcheng Exp $
*
*/
/**
* DER input buffer ... this is the main abstraction in the DER library which
* actively works with the "untyped byte stream" abstraction. It does so with
* impunity, since it's not intended to be exposed to the anyone who could
* violate the "typed value stream" DER model and hence corrupt the input stream
* of DER values.
*/
super(buf);
}
}
try {
return retval;
} catch (CloneNotSupportedException e) {
throw new IllegalArgumentException(e.toString());
}
}
byte[] toByteArray() {
if (len <= 0)
return null;
return retval;
}
throw new IOException("out of data");
else
}
/**
* Compares this DerInputBuffer for equality with the specified object.
*/
if (other instanceof DerInputBuffer)
else
return false;
}
if (this == other)
return true;
return false;
for (int i = 0; i < max; i++) {
return false;
}
}
return true;
}
throw new IOException("insufficient data");
}
/**
* Returns the unsigned integer which takes up the specified number of bytes
* in this buffer.
*/
throw new IOException("short read, getInteger");
/*
* A prepended zero is used to ensure that the integer is interpreted as
* unsigned even when the high order bit is zero. We don't support
* signed BigInts.
*
* Fix this here ... BigInts aren't expected to have these, and stuff
* like signing (sigsize = f(modulus)) misbehaves.
*/
len--;
skip(1);
}
/*
* Consume the rest of the buffer, returning its value as an unsigned
* integer.
*/
}
/**
* Returns the bit string which takes up the rest of this buffer. This bit
* string must be byte-aligned.
*/
byte[] getBitString() {
return null;
/*
* Just copy the data into an aligned, padded octet buffer, and consume
* the rest of the buffer.
*/
return retval;
}
/**
* Returns the bit string which takes up the rest of this buffer. The bit
* string need not be byte-aligned.
*/
return null;
/*
* Just copy the data into an aligned, padded octet buffer, and consume
* the rest of the buffer.
*/
return bitArray;
}
/**
* Package-access method to optimize output operations
*/
throw new IOException("short DER value (encode)");
}
}