/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
*
* (C) Copyright IBM Corp. 1999 All Rights Reserved.
* Copyright 1997 The Open Group Research Institute. All rights reserved.
*/
/**
* Implements the ASN.1 KerberosTime type.
*
* <xmp>
* KerberosTime ::= GeneralizedTime -- with no fractional seconds
* </xmp>
*
* The timestamps used in Kerberos are encoded as GeneralizedTimes. A
* KerberosTime value shall not include any fractional portions of the
* seconds. As required by the DER, it further shall not include any
* separators, and it shall specify the UTC time zone (Z).
*
* <p>
* This definition reflects the Network Working Group RFC 4120
* specification available at
* <a href="http://www.ietf.org/rfc/rfc4120.txt">
*
* The implementation also includes the microseconds info so that the
* same class can be used as a precise timestamp in Authenticator etc.
*/
// The time when this class is loaded. Used in setNow()
private static long syncTime;
public static final boolean NOW = true;
public static final boolean UNADJUSTED_NOW = false;
kerberosTime = time;
}
kerberosTime = time;
}
}
// This constructor is used in the native code
}
/**
* Constructs a KerberosTime object.
* @param encoding a DER-encoded data.
* @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
* @exception IOException if an I/O error occurs while reading encoded data.
*/
}
// this method only used by KerberosTime class.
// ASN.1 GeneralizedTime format:
// "19700101000000Z"
// | | | | | | |
// 0 4 6 8 | | |
// 10 | |
// 12 |
// 14
//The Date constructor assumes the setting are local relative
//and converts the time to UTC before storing it. Since we
//want the internal representation to correspond to local
//and not UTC time we subtract the UTC time offset.
}
// should be moved to sun.security.krb5.util class
}
}
if (initToNow) {
setNow();
}
}
/**
* Returns a string representation of KerberosTime object.
* @return a string representation of this object.
*/
}
/**
* Encodes this object to a byte array.
* @return a byte array of encoded data.
* @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
* @exception IOException if an I/O error occurs while reading encoded data.
*/
return out.toByteArray();
}
public long getTime() {
return kerberosTime;
}
microSeconds = 0;
}
kerberosTime = time;
microSeconds = 0;
}
return temp;
}
public void setNow() {
if (DEBUG) {
}
microSeconds = 0;
} else {
}
}
public int getMicroSeconds() {
}
}
}
}
clockSkew * 1000L)
return false;
return true;
}
public boolean inClockSkew() {
return inClockSkew(getDefaultSkew());
}
clockSkew * 1000L)
return false;
return true;
}
}
return true;
return false;
}
}
}
if (this == obj) {
return true;
}
if (!(obj instanceof KerberosTime)) {
return false;
}
}
public int hashCode() {
}
public boolean isZero() {
}
public int getSeconds() {
}
}
/**
* Parse (unmarshal) a kerberostime from a DER input stream. This form
* parsing might be used when expanding a value which is part of
* a constructed sequence and uses explicitly tagged type.
*
* @exception Asn1Exception on error.
* @param data the Der input stream value, which contains one or more marshaled value.
* @param explicitTag tag number.
* @param optional indicates if this data field is optional
* @return an instance of KerberosTime.
*
*/
public static KerberosTime parse(DerInputStream data, byte explicitTag, boolean optional) throws Asn1Exception, IOException {
return null;
}
else {
return new KerberosTime(subDer);
}
}
public static int getDefaultSkew() {
try {
}
} catch (KrbException e) {
if (DEBUG) {
"Configuration " +
"using default value " +
e.getMessage());
}
}
return tdiff;
}
return toGeneralizedTimeString();
}
}