jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSContext.java
author sundar
Mon, 31 Aug 2015 17:51:02 +0530
changeset 32434 769b3d81ae69
parent 26630 7973c5ab32da
child 34894 3248b89d1921
permissions -rw-r--r--
8134731: Function.prototype.apply interacts incorrectly with arguments Reviewed-by: attila, hannesw
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
     1
/*
23010
6dadb192ad81 8029235: Update copyright year to match last edit in jdk8 jdk repository for 2013
lana
parents: 20742
diff changeset
     2
 * Copyright (c) 2009, 2013, Oracle and/or its affiliates. All rights reserved.
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
     4
 *
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4336
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4336
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    10
 *
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    15
 * accompanied this code).
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    16
 *
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4336
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4336
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 4336
diff changeset
    23
 * questions.
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    24
 */
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    25
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    26
package com.sun.security.jgss;
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    27
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    28
import org.ietf.jgss.*;
26629
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    29
import sun.security.jgss.GSSContextImpl;
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    30
import sun.security.krb5.internal.AuthorizationData;
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    31
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    32
/**
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    33
 * The extended GSSContext interface for supporting additional
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    34
 * functionalities not defined by {@code org.ietf.jgss.GSSContext},
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    35
 * such as querying context-specific attributes.
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    36
 */
20742
4ae78e8060d6 8008662: Add @jdk.Exported to JDK-specific/exported APIs
alanb
parents: 5506
diff changeset
    37
@jdk.Exported
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    38
public interface ExtendedGSSContext extends GSSContext {
26629
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    39
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    40
    // The impl is almost identical to GSSContextImpl with only 2 differences:
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    41
    // 1. It implements the extended interface
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    42
    // 2. It translates result to data types here in inquireSecContext
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    43
    static class ExtendedGSSContextImpl extends GSSContextImpl
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    44
            implements ExtendedGSSContext {
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    45
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    46
        public ExtendedGSSContextImpl(GSSContextImpl old) {
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    47
            super(old);
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    48
        }
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    49
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    50
        @Override
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    51
        public Object inquireSecContext(InquireType type) throws GSSException {
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    52
            SecurityManager security = System.getSecurityManager();
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    53
            if (security != null) {
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    54
                security.checkPermission(
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    55
                        new InquireSecContextPermission(type.toString()));
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    56
            }
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    57
            Object output = super.inquireSecContext(type.name());
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    58
            if (output != null) {
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    59
                if (type == InquireType.KRB5_GET_AUTHZ_DATA) {
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    60
                    AuthorizationData ad = (AuthorizationData) output;
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    61
                    AuthorizationDataEntry[] authzData =
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    62
                            new AuthorizationDataEntry[ad.count()];
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    63
                    for (int i = 0; i < ad.count(); i++) {
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    64
                        authzData[i] = new AuthorizationDataEntry(
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    65
                                ad.item(i).adType, ad.item(i).adData);
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    66
                    }
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    67
                    output = authzData;
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    68
                }
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    69
            }
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    70
            return output;
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    71
        }
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    72
    }
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    73
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    74
    /**
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    75
     * Return the mechanism-specific attribute associated with {@code type}.
25661
929c829a8400 8043071: Expose session key and KRB_CRED through extended GSS-API
weijun
parents: 23010
diff changeset
    76
     * <p>
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    77
     * If there is a security manager, an {@link InquireSecContextPermission}
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    78
     * with the name {@code type.mech} must be granted. Otherwise, this could
26629
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    79
     * result in a {@link SecurityException}.
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    80
     * <p>
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    81
     * Example:
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    82
     * <pre>
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    83
     *      GSSContext ctxt = m.createContext(...)
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    84
     *      // Establishing the context
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    85
     *      if (ctxt instanceof ExtendedGSSContext) {
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    86
     *          ExtendedGSSContext ex = (ExtendedGSSContext)ctxt;
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    87
     *          try {
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    88
     *              Key key = (key)ex.inquireSecContext(
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    89
     *                      InquireType.KRB5_GET_SESSION_KEY);
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    90
     *              // read key info
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    91
     *          } catch (GSSException gsse) {
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    92
     *              // deal with exception
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    93
     *          }
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    94
     *      }
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    95
     * </pre>
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    96
     * @param type the type of the attribute requested
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    97
     * @return the attribute, see the method documentation for details.
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    98
     * @throws GSSException containing  the following
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
    99
     * major error codes:
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   100
     *   {@link GSSException#BAD_MECH GSSException.BAD_MECH} if the mechanism
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   101
     *   does not support this method,
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   102
     *   {@link GSSException#UNAVAILABLE GSSException.UNAVAILABLE} if the
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   103
     *   type specified is not supported,
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   104
     *   {@link GSSException#NO_CONTEXT GSSException.NO_CONTEXT} if the
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   105
     *   security context is invalid,
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   106
     *   {@link GSSException#FAILURE GSSException.FAILURE} for other
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   107
     *   unspecified failures.
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   108
     * @throws SecurityException if a security manager exists and a proper
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   109
     *   {@link InquireSecContextPermission} is not granted.
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   110
     * @see InquireSecContextPermission
25661
929c829a8400 8043071: Expose session key and KRB_CRED through extended GSS-API
weijun
parents: 23010
diff changeset
   111
     * @see InquireType
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   112
     */
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   113
    public Object inquireSecContext(InquireType type)
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   114
            throws GSSException;
4336
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   115
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   116
    /**
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   117
     * Requests that the delegation policy be respected. When a true value is
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   118
     * requested, the underlying context would use the delegation policy
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   119
     * defined by the environment as a hint to determine whether credentials
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   120
     * delegation should be performed. This request can only be made on the
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   121
     * context initiator's side and it has to be done prior to the first
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   122
     * call to <code>initSecContext</code>.
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   123
     * <p>
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   124
     * When this flag is false, delegation will only be tried when the
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   125
     * {@link GSSContext#requestCredDeleg(boolean) credentials delegation flag}
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   126
     * is true.
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   127
     * <p>
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   128
     * When this flag is true but the
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   129
     * {@link GSSContext#requestCredDeleg(boolean) credentials delegation flag}
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   130
     * is false, delegation will be only tried if the delegation policy permits
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   131
     * delegation.
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   132
     * <p>
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   133
     * When both this flag and the
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   134
     * {@link GSSContext#requestCredDeleg(boolean) credentials delegation flag}
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   135
     * are true, delegation will be always tried. However, if the delegation
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   136
     * policy does not permit delegation, the value of
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   137
     * {@link #getDelegPolicyState} will be false, even
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   138
     * if delegation is performed successfully.
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   139
     * <p>
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   140
     * In any case, if the delegation is not successful, the value returned
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   141
     * by {@link GSSContext#getCredDelegState()} is false, and the value
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   142
     * returned by {@link #getDelegPolicyState()} is also false.
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   143
     * <p>
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   144
     * Not all mechanisms support delegation policy. Therefore, the
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   145
     * application should check to see if the request was honored with the
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   146
     * {@link #getDelegPolicyState() getDelegPolicyState} method. When
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   147
     * delegation policy is not supported, <code>requestDelegPolicy</code>
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   148
     * should return silently without throwing an exception.
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   149
     * <p>
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   150
     * Note: for the Kerberos 5 mechanism, the delegation policy is expressed
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   151
     * through the OK-AS-DELEGATE flag in the service ticket. When it's true,
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   152
     * the KDC permits delegation to the target server. In a cross-realm
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   153
     * environment, in order for delegation be permitted, all cross-realm TGTs
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   154
     * on the authentication path must also have the OK-AS-DELAGATE flags set.
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   155
     * @param state true if the policy should be respected
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   156
     * @throws GSSException containing the following
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   157
     * major error codes:
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   158
     *   {@link GSSException#FAILURE GSSException.FAILURE}
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   159
     */
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   160
    public void requestDelegPolicy(boolean state) throws GSSException;
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   161
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   162
    /**
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   163
     * Returns the delegation policy response. Called after a security context
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   164
     * is established. This method can be only called on the initiator's side.
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   165
     * See {@link ExtendedGSSContext#requestDelegPolicy}.
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   166
     * @return the delegation policy response
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   167
     */
4c792c19266e 6853328: Support OK-AS-DELEGATE flag
weijun
parents: 3483
diff changeset
   168
    public boolean getDelegPolicyState();
3482
4aaa66ce712d 6710360: export Kerberos session key to applications
weijun
parents:
diff changeset
   169
}