jdk/src/share/classes/sun/security/krb5/internal/KrbCredInfo.java
author smarks
Wed, 12 Jan 2011 13:52:09 -0800
changeset 7977 f47f211cd627
parent 5506 202f599c92aa
child 13247 74902cfeb9c6
permissions -rw-r--r--
7008713: diamond conversion of kerberos5 and security tools Reviewed-by: weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 73
diff changeset
     6
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 73
diff changeset
     8
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 73
diff changeset
    20
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 73
diff changeset
    21
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 73
diff changeset
    22
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
/*
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *  (C) Copyright IBM Corp. 1999 All Rights Reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *  Copyright 1997 The Open Group Research Institute.  All rights reserved.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
package sun.security.krb5.internal;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import sun.security.krb5.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import sun.security.util.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import java.util.Vector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
import java.io.IOException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * Implements the ASN.1 KrbCredInfo type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * <xmp>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * KrbCredInfo  ::= SEQUENCE {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 *      key             [0] EncryptionKey,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 *      prealm          [1] Realm OPTIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *      pname           [2] PrincipalName OPTIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 *      flags           [3] TicketFlags OPTIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 *      authtime        [4] KerberosTime OPTIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *      starttime       [5] KerberosTime OPTIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 *      endtime         [6] KerberosTime OPTIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 *      renew-till      [7] KerberosTime OPTIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 *      srealm          [8] Realm OPTIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 *      sname           [9] PrincipalName OPTIONAL,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 *      caddr           [10] HostAddresses OPTIONAL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * </xmp>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * This definition reflects the Network Working Group RFC 4120
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * specification available at
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 * <a href="http://www.ietf.org/rfc/rfc4120.txt">
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
 * http://www.ietf.org/rfc/rfc4120.txt</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
public class KrbCredInfo {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    public EncryptionKey key;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    public Realm prealm; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    public PrincipalName pname; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    public TicketFlags flags; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    public KerberosTime authtime; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    public KerberosTime starttime; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    public KerberosTime endtime; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    public KerberosTime renewTill; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    public Realm srealm; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    public PrincipalName sname; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    public HostAddresses caddr; //optional
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    private KrbCredInfo() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    public KrbCredInfo(
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
                       EncryptionKey new_key,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                       Realm new_prealm,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
                       PrincipalName new_pname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                       TicketFlags new_flags,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
                       KerberosTime new_authtime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
                       KerberosTime new_starttime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                       KerberosTime new_endtime,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                       KerberosTime new_renewTill,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                       Realm new_srealm,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                       PrincipalName new_sname,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                       HostAddresses new_caddr
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
                           ) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        key = new_key;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        prealm = new_prealm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
        pname = new_pname;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        flags = new_flags;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        authtime = new_authtime;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        starttime = new_starttime;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
        endtime = new_endtime;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        renewTill = new_renewTill;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        srealm = new_srealm;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
        sname = new_sname;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        caddr = new_caddr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * Constructs a KrbCredInfo object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     * @param encoding a Der-encoded data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
     * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
     * @exception IOException if an I/O error occurs while reading encoded data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
     * @exception RealmException if an error occurs while parsing a Realm object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    public KrbCredInfo(DerValue encoding)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   114
            throws Asn1Exception, IOException, RealmException{
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
        if (encoding.getTag() != DerValue.tag_Sequence) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        prealm = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
        pname = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        flags = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
        authtime = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        starttime = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        endtime = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        renewTill = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
        srealm = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
        sname = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        caddr = null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
        key = EncryptionKey.parse(encoding.getData(), (byte)0x00, false);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            prealm = Realm.parse(encoding.getData(), (byte)0x01, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            pname = PrincipalName.parse(encoding.getData(), (byte)0x02, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
            flags = TicketFlags.parse(encoding.getData(), (byte)0x03, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            authtime = KerberosTime.parse(encoding.getData(), (byte)0x04, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
            starttime = KerberosTime.parse(encoding.getData(), (byte)0x05, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
            endtime = KerberosTime.parse(encoding.getData(), (byte)0x06, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
            renewTill = KerberosTime.parse(encoding.getData(), (byte)0x07, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            srealm = Realm.parse(encoding.getData(), (byte)0x08, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            sname = PrincipalName.parse(encoding.getData(), (byte)0x09, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
            caddr = HostAddresses.parse(encoding.getData(), (byte)0x0A, true);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
        if (encoding.getData().available() > 0)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
            throw new Asn1Exception(Krb5.ASN1_BAD_ID);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * Encodes an KrbCredInfo object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * @return the byte array of encoded KrbCredInfo object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     * @exception Asn1Exception if an error occurs while decoding an ASN1 encoded data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @exception IOException if an I/O error occurs while reading encoded data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
    public byte[] asn1Encode() throws Asn1Exception, IOException {
7977
f47f211cd627 7008713: diamond conversion of kerberos5 and security tools
smarks
parents: 5506
diff changeset
   160
        Vector<DerValue> v = new Vector<>();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x00), key.asn1Encode()));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        if (prealm != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   163
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x01), prealm.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
        if (pname != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   165
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x02), pname.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        if (flags != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   167
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x03), flags.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        if (authtime != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   169
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x04), authtime.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        if (starttime != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   171
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x05), starttime.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        if (endtime != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   173
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x06), endtime.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        if (renewTill != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   175
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x07), renewTill.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        if (srealm != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   177
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x08), srealm.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        if (sname != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   179
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x09), sname.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        if (caddr != null)
73
cf334423502b 6641312: Fix krb5 codes indentation problems
weijun
parents: 2
diff changeset
   181
            v.addElement(new DerValue(DerValue.createTag(DerValue.TAG_CONTEXT, true, (byte)0x0A), caddr.asn1Encode()));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        DerValue der[] = new DerValue[v.size()];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        v.copyInto(der);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        DerOutputStream out = new DerOutputStream();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
        out.putSequence(der);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        return out.toByteArray();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    public Object clone() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        KrbCredInfo kcred = new KrbCredInfo();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
        kcred.key = (EncryptionKey)key.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
        // optional fields
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        if (prealm != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            kcred.prealm = (Realm)prealm.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        if (pname != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
            kcred.pname = (PrincipalName)pname.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        if (flags != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            kcred.flags = (TicketFlags)flags.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
        if (authtime != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            kcred.authtime = (KerberosTime)authtime.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
        if (starttime != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            kcred.starttime = (KerberosTime)starttime.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        if (endtime != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
            kcred.endtime = (KerberosTime)endtime.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
        if (renewTill != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
            kcred.renewTill = (KerberosTime)renewTill.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
        if (srealm != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
            kcred.srealm = (Realm)srealm.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        if (sname != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            kcred.sname = (PrincipalName)sname.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        if (caddr != null)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
            kcred.caddr = (HostAddresses)caddr.clone();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        return kcred;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
}