Path: blob/master/src/java.security.jgss/share/classes/org/ietf/jgss/package-info.java
41155 views
/*1* Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation. Oracle designates this7* particular file as subject to the "Classpath" exception as provided8* by Oracle in the LICENSE file that accompanied this code.9*10* This code is distributed in the hope that it will be useful, but WITHOUT11* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or12* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License13* version 2 for more details (a copy is included in the LICENSE file that14* accompanied this code).15*16* You should have received a copy of the GNU General Public License version17* 2 along with this work; if not, write to the Free Software Foundation,18* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.19*20* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA21* or visit www.oracle.com if you need additional information or have any22* questions.23*/2425/**26* This package presents a framework that allows application developers to27* make use of security services like authentication, data integrity and28* data confidentiality from a variety of underlying security mechanisms29* like Kerberos, using a unified API. The security mechanisms that an30* application can31* chose to use are identified with unique object identifiers. One example32* of such a mechanism is the Kerberos v5 GSS-API mechanism (object33* identifier 1.2.840.113554.1.2.2). This mechanism is available through34* the default instance of the GSSManager class.<p>35*36* The GSS-API is defined in a language independent way in37* <a href=http://www.ietf.org/rfc/rfc2743.txt>RFC 2743</a>. The Java38* language bindings are defined in39* <a href=http://www.ietf.org/rfc/rfc2853.txt>RFC 2853</a><p>40*41* An application starts out by instantiating a {@code GSSManager}42* which then serves as a factory for a security context. An application43* can use specific principal names and credentials that are also created44* using the GSSManager; or it can instantiate a45* context with system defaults. It then goes through a context46* establishment loop. Once a context is established with the47* peer, authentication is complete. Data protection such as integrity48* and confidentiality can then be obtained from this context.<p>49*50* The GSS-API does not perform any communication with the peer. It merely51* produces tokens that the application must somehow transport to the52* other end.53*54* <h2 id="useSubjectCredsOnly">Credential Acquisition</h2>55* The GSS-API itself does not dictate how an underlying mechanism56* obtains the credentials that are needed for authentication. It is57* assumed that prior to calling the GSS-API, these credentials are58* obtained and stored in a location that the mechanism provider is59* aware of. However, the default model in the Java platform will be60* that mechanism providers must obtain credentials only from the private61* or public credential sets associated with the62* {@link javax.security.auth.Subject Subject} in the63* current access control context. The Kerberos v564* mechanism will search for the required INITIATE and ACCEPT credentials65* ({@link javax.security.auth.kerberos.KerberosTicket KerberosTicket} and66* {@link javax.security.auth.kerberos.KerberosKey KerberosKey}) in67* the private credential set where as some other mechanism might look68* in the public set or in both. If the desired credential is not69* present in the appropriate sets of the current Subject, the GSS-API70* call must fail.<p>71*72* This model has the advantage that credential management73* is simple and predictable from the applications point of view. An74* application, given the right permissions, can purge the credentials in75* the Subject or renew them using standard Java API's. If it purged76* the credentials, it would be sure that the JGSS mechanism would fail,77* or if it renewed a time based credential it would be sure that a JGSS78* mechanism would succeed.<p>79*80* This model does require that a {@link81* javax.security.auth.login JAAS login} be performed in order to82* authenticate and populate a Subject that the JGSS mechanism can later83* utilize. However, applications have the ability to relax this84* restriction by means of a system property:85* {@systemProperty javax.security.auth.useSubjectCredsOnly}. By default86* this system property will be assumed to be {@code true} (even when87* it is unset) indicating that providers must only use the credentials88* that are present in the current Subject. However, if this property is89* explicitly set to false by the application, then it indicates that90* the provider is free to use any credentials cache of its choice. Such91* a credential cache might be a disk cache, an in-memory cache, or even92* just the current Subject itself.93*94* <h2>Related Documentation</h2>95* For an online tutorial on using Java GSS-API, please see96* {@extLink security_guide_jgss_tutorial97* Introduction to JAAS and Java GSS-API}.98*99* @since 1.4100* */101package org.ietf.jgss;102103104