config root man

Current Path : /usr/opt/openssl11/share/doc/openssl/html/man3/

FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64
Upload File :
Current File : //usr/opt/openssl11/share/doc/openssl/html/man3/X509_NAME_get_index_by_OBJ.html

<?xml version="1.0" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>X509_NAME_get_index_by_NID</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rev="made" href="mailto:root@hsxx.drive.ne.jp" />
</head>

<body style="background-color: white">


<!-- INDEX BEGIN -->
<div name="index">
<p><a name="__index__"></a></p>

<ul>

	<li><a href="#name">NAME</a></li>
	<li><a href="#synopsis">SYNOPSIS</a></li>
	<li><a href="#description">DESCRIPTION</a></li>
	<li><a href="#notes">NOTES</a></li>
	<li><a href="#return_values">RETURN VALUES</a></li>
	<li><a href="#examples">EXAMPLES</a></li>
	<li><a href="#see_also">SEE ALSO</a></li>
	<li><a href="#copyright">COPYRIGHT</a></li>
</ul>

<hr name="index" />
</div>
<!-- INDEX END -->

<p>
</p>
<hr />
<h1><a name="name">NAME</a></h1>
<p>X509_NAME_get_index_by_NID, X509_NAME_get_index_by_OBJ, X509_NAME_get_entry,
X509_NAME_entry_count, X509_NAME_get_text_by_NID, X509_NAME_get_text_by_OBJ -
X509_NAME lookup and enumeration functions</p>
<p>
</p>
<hr />
<h1><a name="synopsis">SYNOPSIS</a></h1>
<pre>
 #include &lt;openssl/x509.h&gt;</pre>
<pre>
 int X509_NAME_get_index_by_NID(X509_NAME *name, int nid, int lastpos);
 int X509_NAME_get_index_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, int lastpos);</pre>
<pre>
 int X509_NAME_entry_count(const X509_NAME *name);
 X509_NAME_ENTRY *X509_NAME_get_entry(const X509_NAME *name, int loc);</pre>
<pre>
 int X509_NAME_get_text_by_NID(X509_NAME *name, int nid, char *buf, int len);
 int X509_NAME_get_text_by_OBJ(X509_NAME *name, const ASN1_OBJECT *obj, char *buf, int len);</pre>
<p>
</p>
<hr />
<h1><a name="description">DESCRIPTION</a></h1>
<p>These functions allow an <strong>X509_NAME</strong> structure to be examined. The
<strong>X509_NAME</strong> structure is the same as the <strong>Name</strong> type defined in
<a href="http://www.ietf.org/rfc/rfc2459.txt" class="rfc">RFC2459</a> (and elsewhere) and used for example in certificate subject
and issuer names.</p>
<p>X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ() retrieve
the next index matching <strong>nid</strong> or <strong>obj</strong> after <strong>lastpos</strong>. <strong>lastpos</strong>
should initially be set to -1. If there are no more entries -1 is returned.
If <strong>nid</strong> is invalid (doesn't correspond to a valid OID) then -2 is returned.</p>
<p>X509_NAME_entry_count() returns the total number of entries in <strong>name</strong>.</p>
<p>X509_NAME_get_entry() retrieves the <strong>X509_NAME_ENTRY</strong> from <strong>name</strong>
corresponding to index <strong>loc</strong>. Acceptable values for <strong>loc</strong> run from
0 to (X509_NAME_entry_count(name) - 1). The value returned is an
internal pointer which must not be freed.</p>
<p>X509_NAME_get_text_by_NID(), X509_NAME_get_text_by_OBJ() retrieve
the &quot;text&quot; from the first entry in <strong>name</strong> which matches <strong>nid</strong> or
<strong>obj</strong>, if no such entry exists -1 is returned. At most <strong>len</strong> bytes
will be written and the text written to <strong>buf</strong> will be null
terminated. The length of the output string written is returned
excluding the terminating null. If <strong>buf</strong> is &lt;NULL&gt; then the amount
of space needed in <strong>buf</strong> (excluding the final null) is returned.</p>
<p>
</p>
<hr />
<h1><a name="notes">NOTES</a></h1>
<p>X509_NAME_get_text_by_NID() and X509_NAME_get_text_by_OBJ() should be
considered deprecated because they
have various limitations which make them
of minimal use in practice. They can only find the first matching
entry and will copy the contents of the field verbatim: this can
be highly confusing if the target is a multicharacter string type
like a BMPString or a UTF8String.</p>
<p>For a more general solution X509_NAME_get_index_by_NID() or
X509_NAME_get_index_by_OBJ() should be used followed by
X509_NAME_get_entry() on any matching indices and then the
various <strong>X509_NAME_ENTRY</strong> utility functions on the result.</p>
<p>The list of all relevant <strong>NID_*</strong> and <strong>OBJ_* codes</strong> can be found in
the source code header files &lt;openssl/obj_mac.h&gt; and/or
&lt;openssl/objects.h&gt;.</p>
<p>Applications which could pass invalid NIDs to X509_NAME_get_index_by_NID()
should check for the return value of -2. Alternatively the NID validity
can be determined first by checking OBJ_nid2obj(nid) is not NULL.</p>
<p>
</p>
<hr />
<h1><a name="return_values">RETURN VALUES</a></h1>
<p>X509_NAME_get_index_by_NID() and X509_NAME_get_index_by_OBJ()
return the index of the next matching entry or -1 if not found.
X509_NAME_get_index_by_NID() can also return -2 if the supplied
NID is invalid.</p>
<p>X509_NAME_entry_count() returns the total number of entries.</p>
<p>X509_NAME_get_entry() returns an <strong>X509_NAME</strong> pointer to the
requested entry or <strong>NULL</strong> if the index is invalid.</p>
<p>
</p>
<hr />
<h1><a name="examples">EXAMPLES</a></h1>
<p>Process all entries:</p>
<pre>
 int i;
 X509_NAME_ENTRY *e;</pre>
<pre>
 for (i = 0; i &lt; X509_NAME_entry_count(nm); i++) {
     e = X509_NAME_get_entry(nm, i);
     /* Do something with e */
 }</pre>
<p>Process all commonName entries:</p>
<pre>
 int lastpos = -1;
 X509_NAME_ENTRY *e;</pre>
<pre>
 for (;;) {
     lastpos = X509_NAME_get_index_by_NID(nm, NID_commonName, lastpos);
     if (lastpos == -1)
         break;
     e = X509_NAME_get_entry(nm, lastpos);
     /* Do something with e */
 }</pre>
<p>
</p>
<hr />
<h1><a name="see_also">SEE ALSO</a></h1>
<p><em>ERR_get_error(3)</em>, <em>d2i_X509_NAME(3)</em></p>
<p>
</p>
<hr />
<h1><a name="copyright">COPYRIGHT</a></h1>
<p>Copyright 2002-2019 The OpenSSL Project Authors. All Rights Reserved.</p>
<p>Licensed under the OpenSSL license (the &quot;License&quot;).  You may not use
this file except in compliance with the License.  You can obtain a copy
in the file LICENSE in the source distribution or at
<a href="https://www.openssl.org/source/license.html">https://www.openssl.org/source/license.html</a>.</p>

</body>

</html>

Man Man