HP Open Source Security for OpenVMS Volume 3: Kerberos > Chapter 6 KRB5 (Kerberos V5) Application Programming Interface

krb5_parse_name — Convert string principal name to protocol format

 » Table of Contents

 » Glossary

 » Index

C Prototype

krb5_error_code krb5_parse_name(
krb5_context context,
const char *name,
krb5_principal *principal );

Arguments

context (input/output) 

The context structure.

name (input) 

Single string representation of a Kerberos principal name.

principal (output) 

Multipart principal format used in the protocols.

Description

This routine converts a single-string representation name of the principal name to the multi-part principal format used in the protocols.

A single-string representation of a Kerberos name consists of one or more principal name components, separated by slashes, optionally followed by the @ character and a realm name. If the realm name is not specified, the local realm is used.

The slash and @ characters can be quoted (included as part of a component rather than as a component separator or realm prefix) by preceding them with a backslash (\) character. Similarly, newline, tab, backspace, and NULL characters can be included in a component by using \n, \t,\b or \0, respectively.

The realm in a Kerberos name cannot contain the slash, colon, or NULL characters.

The *principal argument points to allocated storage that should be freed by the caller (using krb5_free_principal) after use.

Return Values

This routine returns one of the following KRB5 status codes:

0Successful completion.

ENOMEM

Insufficient memory.