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 * (C) Copyright IBM Corp. 1999 All Rights Reserved. 0N/A * Copyright 1997 The Open Group Research Institute. All rights reserved. 0N/A * Implements the ASN.1 KerberosTime type. 0N/A * KerberosTime ::= GeneralizedTime -- with no fractional seconds 0N/A * The timestamps used in Kerberos are encoded as GeneralizedTimes. A 0N/A * KerberosTime value shall not include any fractional portions of the 0N/A * seconds. As required by the DER, it further shall not include any 0N/A * separators, and it shall specify the UTC time zone (Z). 0N/A * This definition reflects the Network Working Group RFC 4120 0N/A * specification available at 2406N/A * The implementation also includes the microseconds info so that the 2406N/A * same class can be used as a precise timestamp in Authenticator etc. 0N/A private long kerberosTime;
// milliseconds since epoch, a Date.getTime() value 2406N/A // The time when this class is loaded. Used in setNow() 0N/A public static final boolean NOW =
true;
0N/A // This constructor is used in the native code 0N/A * Constructs a KerberosTime object. 0N/A * @param encoding a DER-encoded data. 0N/A * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data. 0N/A * @exception IOException if an I/O error occurs while reading encoded data. 0N/A // this method only used by KerberosTime class. 0N/A // ASN.1 GeneralizedTime format: 0N/A // "19700101000000Z" 0N/A //The Date constructor assumes the setting are local relative 0N/A //and converts the time to UTC before storing it. Since we 0N/A //want the internal representation to correspond to local 0N/A //and not UTC time we subtract the UTC time offset. 0N/A // should be moved to sun.security.krb5.util class 0N/A * Returns a string representation of KerberosTime object. 0N/A * @return a string representation of this object. 0N/A * Encodes this object to a byte array. 0N/A * @return a byte array of encoded data. 0N/A * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data. 0N/A * @exception IOException if an I/O error occurs while reading encoded data. 0N/A * Parse (unmarshal) a kerberostime from a DER input stream. This form 0N/A * parsing might be used when expanding a value which is part of 0N/A * a constructed sequence and uses explicitly tagged type. 0N/A * @exception Asn1Exception on error. 0N/A * @param data the Der input stream value, which contains one or more marshaled value. 0N/A * @param explicitTag tag number. 0N/A * @param optional indicates if this data field is optional 0N/A * @return an instance of KerberosTime. 0N/A "using default value " +