2362N/A * Copyright (c) 2000, 2006, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * We store all elements in a hashtable, using <oid, usage> as the 0N/A * key. This makes it easy to locate the specific kind of credential we 0N/A * need. The implementation needs to be optimized for the case where 0N/A * there is just one element (tempCred). 0N/A // XXX Optimization for single mech usage 0N/A // Try the next mechanism 0N/A //e.printStackTrace(); 0N/A }
else throw e;
// else try the next mechanism 0N/A * Returns the remaining lifetime of this credential. The remaining 0N/A * lifetime is defined as the minimum lifetime, either for initiate or 0N/A * for accept, across all elements contained in it. Not terribly 0N/A * useful, but required by GSS-API. 0N/A * Returns the usage mode for this credential. Returns 0N/A * INITIATE_AND_ACCEPT if any one element contained in it supports 0N/A * INITIATE_AND_ACCEPT or if two different elements exist where one 0N/A * support INITIATE_ONLY and the other supports ACCEPT_ONLY. 0N/A "Duplicate element found: " +
0N/A // XXX If not instance of GSSNameImpl then throw exception 0N/A // Application mixing GSS implementations 0N/A * Not all mechanisms support the concept of one credential element 0N/A * that can be used for both initiating and accepting a context. In 0N/A * the event that an application requests usage INITIATE_AND_ACCEPT 0N/A * for a credential from such a mechanism, the GSS framework will 0N/A * need to obtain two different credential elements from the 0N/A * mechanism, one that will have usage INITIATE_ONLY and another 0N/A * that will have usage ACCEPT_ONLY. The mechanism will help the 0N/A * GSS-API realize this by returning a credential element with 0N/A * usage INITIATE_ONLY or ACCEPT_ONLY prompting it to make another 0N/A * call to getCredentialElement, this time with the other usage 0N/A // NOTE: The specification does not define the criteria to compare 0N/A * The RFC says: "Tests if this GSSCredential refers to the same 0N/A * entity as the supplied object. The two credentials must be 0N/A * acquired over the same mechanisms and must refer to the same 0N/A * principal. Returns "true" if the two GSSCredentials refer to 0N/A * the same entity; "false" otherwise." 0N/A * Well, when do two credentials refer to the same principal? Do 0N/A * they need to have one GSSName in common for the different 0N/A * GSSName's that the credential elements return? Or do all 0N/A * GSSName's have to be in common when the names are exported with 0N/A * their respective mechanisms for the credential elements? 0N/A * Returns a hashcode value for this GSSCredential. 0N/A * @return a hashCode value 0N/A // NOTE: The specification does not define the criteria to compare 0N/A * Decide on a criteria for equals first then do this. 0N/A * Returns the specified mechanism's credential-element. 0N/A * @param mechOid - the oid for mechanism to retrieve 0N/A * @param throwExcep - boolean indicating if the function is 0N/A * to throw exception or return null when element is not 0N/A * @return mechanism credential object 0N/A * @exception GSSException of invalid mechanism 0N/A * First see if the default mechanism satisfies the 0N/A * Now just return any element that satisfies the 0N/A "No credential found for: " +
0N/A // skip to next element