Path: blob/master/src/java.security.jgss/share/classes/sun/security/jgss/spi/GSSCredentialSpi.java
41161 views
/*1* Copyright (c) 2000, 2012, 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*/2425package sun.security.jgss.spi;2627import org.ietf.jgss.*;28import java.security.Provider;2930/**31* This interface is implemented by a mechanism specific credential32* element. A GSSCredential is conceptually a container class of several33* credential elements from different mechanisms.34*35* @author Mayank Upadhyay36*/37public interface GSSCredentialSpi {3839public Provider getProvider();4041/**42* Called to invalidate this credential element and release43* any system recourses and cryptographic information owned44* by the credential.45*46* @exception GSSException with major codes NO_CRED and FAILURE47*/48public void dispose() throws GSSException;4950/**51* Returns the principal name for this credential. The name52* is in mechanism specific format.53*54* @return GSSNameSpi representing principal name of this credential55* @exception GSSException may be thrown56*/57public GSSNameSpi getName() throws GSSException;5859/**60* Returns the init lifetime remaining.61*62* @return the init lifetime remaining in seconds63* @exception GSSException may be thrown64*/65public int getInitLifetime() throws GSSException;666768/**69* Returns the accept lifetime remaining.70*71* @return the accept lifetime remaining in seconds72* @exception GSSException may be thrown73*/74public int getAcceptLifetime() throws GSSException;7576/**77* Determines if this credential element can be used by a context78* initiator.79* @return true if it can be used for initiating contexts80*/81public boolean isInitiatorCredential() throws GSSException;8283/**84* Determines if this credential element can be used by a context85* acceptor.86* @return true if it can be used for accepting contexts87*/88public boolean isAcceptorCredential() throws GSSException;8990/**91* Returns the oid representing the underlying credential92* mechanism oid.93*94* @return the Oid for this credential mechanism95* @exception GSSException may be thrown96*/97public Oid getMechanism();9899/**100* Impersonates another client.101*102* @param name the client to impersonate103* @return the new credential104* @exception GSSException may be thrown105*/106public GSSCredentialSpi impersonate(GSSNameSpi name) throws GSSException;107}108109110