71 lines
5.3 KiB
HTML
71 lines
5.3 KiB
HTML
|
<?xml version="1.0" encoding="UTF-8"?>
|
||
|
<!DOCTYPE html
|
||
|
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||
|
<html lang="en-us" xml:lang="en-us">
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
||
|
<meta name="security" content="public" />
|
||
|
<meta name="Robots" content="index,follow" />
|
||
|
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
|
||
|
<meta name="DC.Type" content="concept" />
|
||
|
<meta name="DC.Title" content="Creating a GSSCredential" />
|
||
|
<meta name="abstract" content="A GSSCredential contains all the cryptographic information necessary to create a context on behalf of a principal and can contain credential information for multiple mechanisms." />
|
||
|
<meta name="description" content="A GSSCredential contains all the cryptographic information necessary to create a context on behalf of a principal and can contain credential information for multiple mechanisms." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahajgssdev10.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahajgssdev1020.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahajgssdev1040.htm" />
|
||
|
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
|
||
|
<meta name="DC.Format" content="XHTML" />
|
||
|
<meta name="DC.Identifier" content="rzahajgssdev1030" />
|
||
|
<meta name="DC.Language" content="en-us" />
|
||
|
<!-- All rights reserved. Licensed Materials Property of IBM -->
|
||
|
<!-- US Government Users Restricted Rights -->
|
||
|
<!-- Use, duplication or disclosure restricted by -->
|
||
|
<!-- GSA ADP Schedule Contract with IBM Corp. -->
|
||
|
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
|
||
|
<link rel="stylesheet" type="text/css" href="./ic.css" />
|
||
|
<title>Creating a GSSCredential</title>
|
||
|
</head>
|
||
|
<body id="rzahajgssdev1030"><a name="rzahajgssdev1030"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Creating a GSSCredential</h1>
|
||
|
<div><p>A GSSCredential contains all the cryptographic information necessary
|
||
|
to create a context on behalf of a principal and can contain credential information
|
||
|
for multiple mechanisms.</p>
|
||
|
<p>GSSManager has three credential creation methods. Two of the methods take
|
||
|
for parameters a GSSName, the lifetime of the credential, one or more mechanisms
|
||
|
from which to get credentials, and the credential usage type. The third method
|
||
|
takes only a usage type and uses the default values for other parameters.
|
||
|
Specifying a null mechanism also uses the default mechanism. Specifying a
|
||
|
null array of mechanisms causes the method to return credentials for the default
|
||
|
set of mechanisms.</p>
|
||
|
<div class="note"><span class="notetitle">Note:</span> Because IBM<sup>®</sup> JGSS
|
||
|
supports only the Kerberos V5 mechanism, that is the default mechanism.</div>
|
||
|
<p>Your application can create only one of the three credentials types (<var class="varname">initiate,</var> <var class="varname">accept</var>,
|
||
|
or <var class="varname">initiate and accept</var>) at a time.</p>
|
||
|
<ul><li>A context initiator creates <var class="varname">initiate</var> credentials</li>
|
||
|
<li>An acceptor creates <var class="varname">accept</var> credentials</li>
|
||
|
<li>An acceptor that also behaves as an initiator creates <var class="varname">initiate
|
||
|
and accept</var> credentials.</li>
|
||
|
</ul>
|
||
|
<p><strong>Examples: Obtaining credentials</strong></p>
|
||
|
<p>The following example obtains the default credentials for an initiator:</p>
|
||
|
<pre>GSSCredentials fooCreds = manager.createCredentials(GSSCredential.INITIATE)</pre>
|
||
|
<p>The following example obtains Kerberos V5 credentials for the initiator <em>foo</em> that
|
||
|
have the default validity period:</p>
|
||
|
<pre>GSSCredential fooCreds = manager.createCredential(fooName, GSSCredential.DEFAULT_LIFETIME,
|
||
|
krb5Mech,GSSCredential.INITIATE);</pre>
|
||
|
<p>The following example obtains an all-default acceptor credential:</p>
|
||
|
<pre>GSSCredential serverCreds = manager.createCredential(null, GSSCredential.DEFAULT_LIFETIME,
|
||
|
(Oid)null, GSSCredential.ACCEPT);</pre>
|
||
|
</div>
|
||
|
<div>
|
||
|
<div class="familylinks">
|
||
|
<div class="parentlink"><strong>Parent topic:</strong> <a href="rzahajgssdev10.htm" title="There are multiple steps required to develop a JGSS application, including using transport tokens, creating the necessary JGSS objects, establishing and deleting context, and using per-message services.">IBM JGSS application programming steps</a></div>
|
||
|
<div class="previouslink"><strong>Previous topic:</strong> <a href="rzahajgssdev1020.htm" title="GSSName represents the identity of a GSS-API principal. A GSSName may contain many representations of the principal, one for each supported underlying mechanism. A GSSName that contains only one name representation is called a Mechanism Name (MN).">Creating a GSSName</a></div>
|
||
|
<div class="nextlink"><strong>Next topic:</strong> <a href="rzahajgssdev1040.htm" title="IBM JGSS supports two methods provided by GSSManager for creating a context.">Creating GSSContext</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|