CertLevels (Socket function): Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (1 revision)
m (→‎Syntax terms: link repair)
 
(8 intermediate revisions by 3 users not shown)
Line 1: Line 1:
<span class="pageSubtitle"><section begin=dpl_desc/><section end=dpl_desc/></span>
{{Template:Socket:CertLevels subtitle}}
[[Category:Socket methods|CertLevels function]]
<p>
<var>CertLevels</var> is a member of the <var>[[Socket class|Socket]]</var> class.
</p>


This method retrieves the number of
This method retrieves the number of
Line 9: Line 5:
The <var>CertLevels</var> function has an effect similar to
The <var>CertLevels</var> function has an effect similar to
its equivalent $function, <var>[[$Sock_Cert_Levels]]</var>.
its equivalent $function, <var>[[$Sock_Cert_Levels]]</var>.
==Syntax==
==Syntax==
<p class="syntax">%cl = %socko:CertLevels
{{Template:Socket:CertLevels syntax}}
</p>
 
===Syntax terms===
===Syntax terms===
<table class="syntaxTable">
<table>
<tr><th>%cl</th>
<tr><th>%number</th>
<td>Return string, which contains the value of the number of levels of the certificate provided by the remote partner on a socket.
<td>Return string, which contains the value of the number of levels of the certificate provided by the remote partner on a socket.
If no such certificate was provided, the null string is returned. Otherwise, level 0 corresponds to the client or the "subject" of the certificate; level 1 to the "signer" of the certificate; level 2 to the "signer" of the level 1 signer's certificate; and so on.
If no such certificate was provided, the null string is returned. Otherwise, level 0 corresponds to the client or the "subject" of the certificate; level 1 to the "signer" of the certificate; level 2 to the "signer" of the level 1 signer's certificate; and so on.
Since all certificates accepted by <var class="product">Janus Network Security</var> must be signed, <var class="term">%cl</var> will always be greater than or equal to 2 if non-zero. Level 3 would indicate a certificate that includes an intermediate certificate.
 
For information on the data that can be retrieved for each certificate level see <var>[[CertInfo (Socket function)|CertInfo]]</var>. To learn more about client certificates, see the [http://www.sirius-software.com/maint/download/jansslr.pdf Janus Network Security Reference Manual].
Since all certificates accepted by <var class="product">Janus Network Security</var> must be signed, <var class="term">%number</var> will always be greater than or equal to 2 if non-zero. Level 3 would indicate a certificate that includes an intermediate certificate.
 
For information on the data that can be retrieved for each certificate level see <var>[[CertInfo (Socket function)|CertInfo]]</var>. To learn more about client certificates, see [[Janus Network Security]].
</td></tr>
</td></tr>
<tr><th>%socko</th>
<td>A variable or an expression that is a reference to a socket object.


<tr><th>socket</th>
<td>A variable or an expression that is a reference to a <var>Socket</var> object.
</td></tr></table>
</td></tr></table>


==Usage notes==
==Usage notes==
<ul>
<ul>
<li><var>CertLevels</var> returns the value -1 if the socket is not open
<li><var>CertLevels</var> returns the value <code>-1</code> if the socket is not open
and <code>ONRESET CONTINUE</code> is in effect for the socket.
and <code>ONRESET CONTINUE</code> is in effect for the socket. </li>
 
<li>A <var>CertLevels</var> call may cause an [[CertInfo (Socket function)#reneg|SSL renegotiation]] in order to
<li>A <var>CertLevels</var> call may cause an [[CertInfo (Socket function)#reneg|SSL renegotiation]] in order to
request a digital certificate from the client.
request a digital certificate from the client. </li>
 
<li>To retrieve any of the certificate entity values, you can use the <var>[[CertInfo (Socket function)|CertInfo]]</var> function. </li>
</ul>
</ul>


==Example==
==Example==
The following statement
The following statement
returns the number of levels of the certificate received from the remote partner
returns the number of levels of the certificate received from the remote partner
Line 40: Line 41:
<p class="code">%count = %sok:Certlevels
<p class="code">%count = %sok:Certlevels
</p>
</p>
==See also==
{{Template:Socket:CertLevels footer}}

Latest revision as of 19:06, 1 June 2016

Number of levels of the SSL certificate (Socket class)


This method retrieves the number of levels of the SSL certificate provided on a socket by the remote partner. The CertLevels function has an effect similar to its equivalent $function, $Sock_Cert_Levels.

Syntax

%number = socket:CertLevels

Syntax terms

%number Return string, which contains the value of the number of levels of the certificate provided by the remote partner on a socket.

If no such certificate was provided, the null string is returned. Otherwise, level 0 corresponds to the client or the "subject" of the certificate; level 1 to the "signer" of the certificate; level 2 to the "signer" of the level 1 signer's certificate; and so on.

Since all certificates accepted by Janus Network Security must be signed, %number will always be greater than or equal to 2 if non-zero. Level 3 would indicate a certificate that includes an intermediate certificate.

For information on the data that can be retrieved for each certificate level see CertInfo. To learn more about client certificates, see Janus Network Security.

socket A variable or an expression that is a reference to a Socket object.

Usage notes

  • CertLevels returns the value -1 if the socket is not open and ONRESET CONTINUE is in effect for the socket.
  • A CertLevels call may cause an SSL renegotiation in order to request a digital certificate from the client.
  • To retrieve any of the certificate entity values, you can use the CertInfo function.

Example

The following statement returns the number of levels of the certificate received from the remote partner using the %sok socket:

%count = %sok:Certlevels

See also