/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This utility looks through the current Subject and retrieves private
*
* @author Ram Marti
* @since 1.4.2
*/
class SubjectComber {
/**
* Default constructor
*/
}
true);
}
false);
}
/**
* in the subject. Returns null if the subject is null.
*
* @return the private credentials
*/
return null;
} else {
// We are looking for credentials unrelated to serverPrincipal
if (DEBUG) {
}
if (oneOnly) {
return t;
} else {
}
}
} else if (credClass == KerberosKey.class) {
// We are looking for credentials for the serverPrincipal
if (DEBUG) {
}
if (oneOnly) {
return t;
} else {
if (serverPrincipal == null) {
// Record name so that keys returned will all
// belong to the same principal
}
}
}
}
} else if (credClass == KerberosTicket.class) {
// we are looking for a KerberosTicket credentials
// for client-service principal pair
synchronized (pcs) {
if (obj instanceof KerberosTicket) {
if (DEBUG) {
+ " to go to "
+ " expiring on "
+ ticket.getEndTime());
}
// let us remove the ticket from the Subject
// Note that both TGT and service ticket will be
// removed upon expiration
if (!subject.isReadOnly()) {
try {
if (DEBUG) {
+ "the expired Ticket \n"
+ ticket);
}
} catch (DestroyFailedException dfe) {
if (DEBUG) {
" detroyed successfully. " + dfe);
}
}
}
} else {
if (serverPrincipal == null ||
if (clientPrincipal == null ||
if (oneOnly) {
return ticket;
} else {
// Record names so that tickets will
// all belong to same principals
if (clientPrincipal == null) {
}
if (serverPrincipal == null) {
}
}
}
}
}
}
}
}
}
return answer;
}
}
}