< prev index next >

## src/java.security.jgss/share/classes/javax/security/auth/kerberos/KerberosTicket.java

Print this page

      1 /*
      2  * Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.
      3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      4  *
      5  * This code is free software; you can redistribute it and/or modify it
      6  * under the terms of the GNU General Public License version 2 only, as
      7  * published by the Free Software Foundation.  Oracle designates this
      8  * particular file as subject to the "Classpath" exception as provided
      9  * by Oracle in the LICENSE file that accompanied this code.
     10  *
     11  * This code is distributed in the hope that it will be useful, but WITHOUT
     12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     14  * version 2 for more details (a copy is included in the LICENSE file that
     15  * accompanied this code).
     16  *
     17  * You should have received a copy of the GNU General Public License version
     18  * 2 along with this work; if not, write to the Free Software Foundation,
     19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
     20  *
     21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
     22  * or visit www.oracle.com if you need additional information or have any
    822             }
    823         }
    824
    825         if (renewTill == null) {
    826             if (otherTicket.getRenewTill() != null) {
    827                 return false;
    828             }
    829         } else {
    830             if (!renewTill.equals(otherTicket.getRenewTill())) {
    831                 return false;
    832             }
    833         }
    834
    835         if (!Objects.equals(proxy, otherTicket.proxy)) {
    836             return false;
    837         }
    838
    839         return true;
    840     }
    841

    842     private void readObject(ObjectInputStream s)
    843             throws IOException, ClassNotFoundException {
    844         s.defaultReadObject();
    845         if (sessionKey == null) {
    846            throw new InvalidObjectException("Session key cannot be null");
    847         }
    848         try {
    849             init(asn1Encoding, client, server, sessionKey,
    850                  flags, authTime, startTime, endTime,
    851                  renewTill, clientAddresses);
    852         } catch (IllegalArgumentException iae) {
    853             throw (InvalidObjectException)
    854                 new InvalidObjectException(iae.getMessage()).initCause(iae);
    855         }
    856     }
    857 }
      1 /*
      2  * Copyright (c) 2000, 2021, Oracle and/or its affiliates. All rights reserved.
      3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
      4  *
      5  * This code is free software; you can redistribute it and/or modify it
      6  * under the terms of the GNU General Public License version 2 only, as
      7  * published by the Free Software Foundation.  Oracle designates this
      8  * particular file as subject to the "Classpath" exception as provided
      9  * by Oracle in the LICENSE file that accompanied this code.
     10  *
     11  * This code is distributed in the hope that it will be useful, but WITHOUT
     12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
     13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
     14  * version 2 for more details (a copy is included in the LICENSE file that
     15  * accompanied this code).
     16  *
     17  * You should have received a copy of the GNU General Public License version
     18  * 2 along with this work; if not, write to the Free Software Foundation,
     19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
     20  *
     21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
     22  * or visit www.oracle.com if you need additional information or have any
    822             }
    823         }
    824
    825         if (renewTill == null) {
    826             if (otherTicket.getRenewTill() != null) {
    827                 return false;
    828             }
    829         } else {
    830             if (!renewTill.equals(otherTicket.getRenewTill())) {
    831                 return false;
    832             }
    833         }
    834
    835         if (!Objects.equals(proxy, otherTicket.proxy)) {
    836             return false;
    837         }
    838
    839         return true;
    840     }
    841
    842     /**
    843      * Restores the state of this object from the stream.
    844      *
    845      * @param  s the {@code ObjectInputStream} from which data is read
    846      * @throws IOException if an I/O error occurs
    847      * @throws ClassNotFoundException if a serialized class cannot be loaded
    848      */
    849     private void readObject(ObjectInputStream s)
    850             throws IOException, ClassNotFoundException {
    851         s.defaultReadObject();
    852         if (sessionKey == null) {
    853            throw new InvalidObjectException("Session key cannot be null");
    854         }
    855         try {
    856             init(asn1Encoding, client, server, sessionKey,
    857                  flags, authTime, startTime, endTime,
    858                  renewTill, clientAddresses);
    859         } catch (IllegalArgumentException iae) {
    860             throw (InvalidObjectException)
    861                 new InvalidObjectException(iae.getMessage()).initCause(iae);
    862         }
    863     }
    864 }

< prev index next >