ibm-information-center/dist/eclipse/plugins/i5OS.ic.apis_5.4.0.1/krb5_build_principal.htm

156 lines
3.7 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Copyright" content="Copyright (c) 2006 by IBM Corporation">
<title>krb5_build_principal()--Build a Kerberos Principal</title>
<!-- Begin Header Records -->
<!-- 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. -->
<!-- Change History: -->
<!-- YYMMDD USERID Change description -->
<!-- Created by Kent Hofer for V5R1 -->
<!-- Edited by Kersten Jan 02 -->
<link rel="stylesheet" type="text/css" href="../rzahg/ic.css">
</head>
<body>
<!-- End Header Records -->
<!--Java sync-link-->
<script type="text/javascript" language="Javascript" src="../rzahg/synch.js">
</script>
<a name="Top_Of_Page"></a>
<h2>krb5_build_principal()--Build a Kerberos Principal</h2>
<div class="box" style="width: 70%;">
<br>
&nbsp;&nbsp;Syntax
<pre>
#include &lt;krb5.h&gt;
krb5_error_code krb5_build_principal(
krb5_context <em>context</em>,
krb5_principal * <em>ret_principal</em>,
int <em>realm_length</em>,
krb5_const char * <em>realm</em>,
char * <em>name1, name2, ...</em>);
</pre>
&nbsp;&nbsp;Service Program Name: QSYS/QKRBGSS<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Default Public Authority: *USE<br>
<!-- iddvc RMBR -->
<br>
&nbsp;&nbsp;Threadsafe: Yes<br>
<!-- iddvc RMBR -->
<br>
</div>
<p>The <strong>krb5_build_principal()</strong> function builds a Kerberos
principal from its component strings.</p>
<br>
<h3>Authorities</h3>
<p>No authorities are required.</p>
<br>
<h3>Parameters</h3>
<dl>
<dt><strong>context</strong>&nbsp;&nbsp;(Input)</dt>
<dd>The Kerberos context.<br>
<br>
</dd>
<dt><strong>ret_principal</strong>&nbsp;&nbsp;(Output)</dt>
<dd>The Kerberos principal. The <strong>krb5_free_principal()</strong> routine
should be called to release the principal when it is no longer needed.<br>
<br>
</dd>
<dt><strong>realm_length</strong>&nbsp;&nbsp;(Input)</dt>
<dd>The length of the realm name.<br>
<br>
</dd>
<dt><strong>realm</strong>&nbsp;&nbsp;(Input)</dt>
<dd>The realm name.<br>
<br>
</dd>
<dt><strong>name1, name2, ...</strong>&nbsp;&nbsp;(Input)</dt>
<dd>One or more name components. The end of the components is indicated by
specifying <strong>NULL</strong> for the parameter.</dd>
</dl>
<br>
<h3>Return Value</h3>
<p>If no errors occur, the return value is 0. Otherwise, a Kerberos error code
is returned.</p>
<br>
<h3>Error Messages</h3>
<table width="100%" cellpadding="5">
<tr>
<th align="left" valign="top">Message ID</th>
<th align="left" valign="top">Error Message Text</th>
</tr>
<tr>
<td width="15%" valign="top">CPE3418 E</td>
<td width="85%" valign="top">Possible APAR condition or hardware failure.</td>
</tr>
</table>
<br>
<h3>Example</h3>
<p>See <a href="../apiref/aboutapis.htm#codedisclaimer">Code disclaimer information</a>
for information pertaining to code examples.</p>
<p>The following example creates the principal bambi/admin@forest:</p>
<pre>
#include &lt;krb5.h&gt;
retval = krb5_build_principal(context, &amp;princ, 6, "forest", "bambi", "admin", NULL);
</pre>
<br>
<hr>
API introduced: V5R1
<hr>
<center>
<table cellpadding="2" cellspacing="2">
<tr align="center">
<td valign="middle" align="center"><a href="#Top_Of_Page">Top</a> | <a href=
"sec.htm">Security APIs</a> <br>
<a href="unix.htm">UNIX-Type APIs</a> | <a href="aplist.htm">APIs by
category</a> </td>
</tr>
</table>
</center>
</body>
</html>