jdk/src/jdk.security.jgss/share/classes/com/sun/security/jgss/ExtendedGSSCredential.java
author hannesw
Mon, 23 Nov 2015 17:52:04 +0100
changeset 34446 a0dd624a12a7
parent 26630 7973c5ab32da
child 34894 3248b89d1921
permissions -rw-r--r--
8143821: Wrong test name in JDK-8143304 Reviewed-by: attila, sundar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
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) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
     4
 *
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    10
 *
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    15
 * accompanied this code).
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    16
 *
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    20
 *
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    23
 * questions.
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    24
 */
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    25
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    26
package com.sun.security.jgss;
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    27
e954df027393 6355584: Introduce constrained Kerberos delegation
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.GSSCredentialImpl;
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    30
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    31
/**
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    32
 * The extended GSSCredential interface for supporting additional
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    33
 * functionalities not defined by {@code org.ietf.jgss.GSSCredential}.
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    34
 * @since 1.8
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    35
 */
20742
4ae78e8060d6 8008662: Add @jdk.Exported to JDK-specific/exported APIs
alanb
parents: 14413
diff changeset
    36
@jdk.Exported
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    37
public interface ExtendedGSSCredential extends GSSCredential {
26629
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    38
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    39
    static class ExtendedGSSCredentialImpl extends GSSCredentialImpl
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    40
            implements ExtendedGSSCredential {
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    41
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    42
        public ExtendedGSSCredentialImpl(GSSCredentialImpl old) {
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    43
            super(old);
3b9ed8175488 8042900: Allow com.sun.security.jgss to be in different module than org.ietf.jgss
weijun
parents: 25859
diff changeset
    44
        }
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
14413
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    47
    /**
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    48
     * Impersonates a principal. In Kerberos, this can be implemented
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    49
     * using the Microsoft S4U2self extension.
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    50
     * <p>
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    51
     * A {@link GSSException#NO_CRED GSSException.NO_CRED} will be thrown if the
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    52
     * impersonation fails. A {@link GSSException#FAILURE GSSException.FAILURE}
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    53
     * will be  thrown if the impersonation method is not available to this
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    54
     * credential object.
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    55
     * @param name the name of the principal to impersonate
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    56
     * @return a credential for that principal
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    57
     * @throws GSSException  containing the following
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    58
     * major error codes:
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    59
     *   {@link GSSException#NO_CRED GSSException.NO_CRED}
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    60
     *   {@link GSSException#FAILURE GSSException.FAILURE}
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    61
     */
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    62
    public GSSCredential impersonate(GSSName name) throws GSSException;
e954df027393 6355584: Introduce constrained Kerberos delegation
weijun
parents:
diff changeset
    63
}