2362N/A * Copyright (c) 1996, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * DER input buffer ... this is the main abstraction in the DER library 0N/A * which actively works with the "untyped byte stream" abstraction. It 0N/A * does so with impunity, since it's not intended to be exposed to 0N/A * anyone who could violate the "typed value stream" DER model and hence 0N/A * corrupt the input stream of DER values. 0N/A * @author David Brownell 0N/A * Compares this DerInputBuffer for equality with the specified 0N/A for (
int i =
0; i <
max; i++) {
0N/A * Returns a hashcode for this DerInputBuffer. 0N/A * @return a hashcode for this DerInputBuffer. 0N/A * Returns the integer which takes up the specified number 0N/A * of bytes in this buffer as a BigInteger. 0N/A * @param len the number of bytes to use. 0N/A * @param makePositive whether to always return a positive value, 0N/A * irrespective of actual encoding 0N/A * @return the integer as a BigInteger. 0N/A * Returns the integer which takes up the specified number 0N/A * of bytes in this buffer. 0N/A * @throws IOException if the result is not within the valid 0N/A * range for integer, i.e. between Integer.MIN_VALUE and 0N/A * Integer.MAX_VALUE. 0N/A * @param len the number of bytes to use. 0N/A * @return the integer. 0N/A * Returns the bit string which takes up the specified 0N/A * number of bytes in this buffer. 0N/A // minus the first byte which indicates the number of padding bits 0N/A // get rid of the padding bits 0N/A * Returns the bit string which takes up the rest of this buffer. 0N/A * Returns the bit string which takes up the rest of this buffer. 0N/A * The bit string need not be byte-aligned. 0N/A * Just copy the data into an aligned, padded octet buffer, 0N/A * and consume the rest of the buffer. 0N/A // number of valid bits 0N/A * Returns the UTC Time value that takes up the specified number 0N/A * of bytes in this buffer. 0N/A * @param len the number of bytes to use 0N/A * Returns the Generalized Time value that takes up the specified 0N/A * number of bytes in this buffer. 0N/A * @param len the number of bytes to use 0N/A * Private helper routine to extract time from the der value. 0N/A * @param len the number of bytes to use 0N/A * @param generalized true if Generalized Time is to be read, false 0N/A * if UTC Time is to be read. 0N/A * UTC time encoded as ASCII chars: 0N/A * UTC Time is broken in storing only two digits of year. 0N/A * If YY < 50, we assume 20YY; 0N/A * if YY >= 50, we assume 19YY, as per RFC 3280. 0N/A * Generalized time has a four-digit year and allows any 0N/A * precision specified in ISO 8601. However, for our purposes, 0N/A * we will only allow the same format as UTC time, except that 0N/A * fractional seconds (millisecond precision) are supported. 0N/A len -=
2;
// For the two extra YY 0N/A * We allow for non-encoded seconds, even though the 0N/A * IETF-PKIX specification says that the seconds should 0N/A * always be encoded even if it is zero. 0N/A // handle fractional seconds (if present) 0N/A // handle upto milisecond precision only 0N/A " time, unsupported precision for seconds value");
0N/A * Generalized time can theoretically allow any precision, 0N/A * but we're not supporting that. 0N/A * Finally, "Z" or "+hhmm" or "-hhmm" ... offsets change hhmm