73 lines
5.0 KiB
HTML
73 lines
5.0 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 GSSName" />
|
||
|
<meta name="abstract" content="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)." />
|
||
|
<meta name="description" content="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)." />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahajgssdev10.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahajgssdev1010.htm" />
|
||
|
<meta name="DC.Relation" scheme="URI" content="rzahajgssdev1030.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="rzahajgssdev1020" />
|
||
|
<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 GSSName</title>
|
||
|
</head>
|
||
|
<body id="rzahajgssdev1020"><a name="rzahajgssdev1020"><!-- --></a>
|
||
|
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
|
||
|
<h1 class="topictitle1">Creating a GSSName</h1>
|
||
|
<div><p>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).</p>
|
||
|
<p>GSSManager has several overloaded methods for creating a GSSName from a
|
||
|
string or a contiguous array of bytes. The methods interpret the string or
|
||
|
byte array according to a specified name type. Typically, you use the GSSName
|
||
|
byte-array methods to reconstitute an exported name. The exported name
|
||
|
is usually a mechanism name of type GSSName.NT_EXPORT_NAME. Some of these
|
||
|
methods allow you to specify a security mechanism with which to create the
|
||
|
name.</p>
|
||
|
<div class="section"><h4 class="sectiontitle">Example: Using GSSName</h4><p>The following
|
||
|
basic code snippet shows how to use GSSName.</p>
|
||
|
<div class="note"><span class="notetitle">Note:</span> Specify Kerberos service
|
||
|
name strings as either <service> or <service@host> where <service>
|
||
|
is the name of the service and <host> is the hostname of the machine
|
||
|
on which the service runs. You can (but do not have to) use a fully qualified
|
||
|
hostname. When you omit the @<host> portion of the string, GSSName uses
|
||
|
the local hostname.</div>
|
||
|
<pre> // Create GSSName for user foo.
|
||
|
GSSName fooName = manager.createName("foo", GSSName.NT_USER_NAME);
|
||
|
|
||
|
// Create a Kerberos V5 mechanism name for user foo.
|
||
|
Oid krb5Mech = new Oid("1.2.840.113554.1.2.2");
|
||
|
GSSName fooName = manager.createName("foo", GSSName.NT_USER_NAME, krb5Mech);
|
||
|
|
||
|
// Create a mechanism name from a non-mechanism name by using the GSSName
|
||
|
// canonicalize method.
|
||
|
GSSName fooName = manager.createName("foo", GSSName.NT_USER_NAME);
|
||
|
GSSName fooKrb5Name = fooName.canonicalize(krb5Mech);</pre>
|
||
|
</div>
|
||
|
</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="rzahajgssdev1010.htm" title="The GSSManager abstract class serves as a factory for creating JGSS objects.">Creating a GSSManager</a></div>
|
||
|
<div class="nextlink"><strong>Next topic:</strong> <a href="rzahajgssdev1030.htm" title="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.">Creating a GSSCredential</a></div>
|
||
|
</div>
|
||
|
</div>
|
||
|
</body>
|
||
|
</html>
|