2005-07-21 21:37:49 +00:00
|
|
|
<?xml version="1.0" encoding="iso-8859-1"?>
|
2009-07-11 09:02:41 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.ssh2-publickey-list">
|
2005-07-21 21:37:49 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>ssh2_publickey_list</refname>
|
|
|
|
<refpurpose>
|
|
|
|
List currently authorized publickeys
|
|
|
|
</refpurpose>
|
|
|
|
</refnamediv>
|
2005-07-24 05:44:27 +00:00
|
|
|
|
2005-07-21 21:37:49 +00:00
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
|
|
|
<methodsynopsis>
|
|
|
|
<type>array</type><methodname>ssh2_publickey_list</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>pkey</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2007-06-15 00:16:47 +00:00
|
|
|
<para>
|
|
|
|
List currently authorized publickeys.
|
|
|
|
</para>
|
2005-07-21 21:37:49 +00:00
|
|
|
</refsect1>
|
2005-07-24 05:44:27 +00:00
|
|
|
|
2005-07-21 21:37:49 +00:00
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>pkey</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Publickey Subsystem resource
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2005-07-24 05:44:27 +00:00
|
|
|
|
2005-07-21 21:37:49 +00:00
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
2005-12-08 12:10:54 +00:00
|
|
|
Returns a numerically indexed array of keys,
|
2005-07-21 21:37:49 +00:00
|
|
|
each of which is an associative array containing:
|
|
|
|
name, blob, and attrs elements.
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<table>
|
|
|
|
<title>Publickey elements</title>
|
2005-07-24 05:44:27 +00:00
|
|
|
<tgroup cols="2">
|
2005-07-21 21:37:49 +00:00
|
|
|
<thead>
|
|
|
|
<row>
|
|
|
|
<entry>Array Key</entry>
|
|
|
|
<entry>Meaning</entry>
|
|
|
|
</row>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<row>
|
|
|
|
<entry>name</entry>
|
|
|
|
<entry>Name of algorithm used by this publickey, for example:
|
2007-06-15 00:16:44 +00:00
|
|
|
<literal>ssh-dss</literal> or <literal>ssh-rsa</literal>.</entry>
|
2005-07-21 21:37:49 +00:00
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>blob</entry>
|
|
|
|
<entry>Publickey blob as raw binary data.</entry>
|
|
|
|
</row>
|
|
|
|
<row>
|
|
|
|
<entry>attrs</entry>
|
2007-06-15 00:16:44 +00:00
|
|
|
<entry>Attributes assigned to this publickey. The most common
|
|
|
|
attribute, and the only one supported by publickey version 1
|
|
|
|
servers, is <literal>comment</literal>, which may be any freeform
|
|
|
|
string.</entry>
|
2005-07-21 21:37:49 +00:00
|
|
|
</row>
|
|
|
|
</tbody>
|
|
|
|
</tgroup>
|
|
|
|
</table>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Listing authorized keys with <function>ssh2_publickey_list</function></title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$ssh2 = ssh2_connect('shell.example.com', 22);
|
|
|
|
ssh2_auth_password($ssh2, 'jdoe', 'secret');
|
|
|
|
$pkey = ssh2_publickey_init($ssh2);
|
|
|
|
|
|
|
|
$list = ssh2_publickey_list($pkey);
|
|
|
|
|
|
|
|
foreach($list as $key) {
|
|
|
|
echo "Key: {$key['name']}\n";
|
|
|
|
echo "Blob: " . chunk_split(base64_encode($key['blob']), 40, "\n") . "\n";
|
|
|
|
echo "Comment: {$key['attrs']['comment']}\n\n";
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
&example.outputs;
|
|
|
|
<screen>
|
|
|
|
<![CDATA[
|
|
|
|
Key: ssh-rsa
|
|
|
|
Blob: AAAAB3NzaC1yc2EAAAABIwAAAIEA5HVt6VqSGd5P
|
|
|
|
TrLRdjNONxXH1tVFGn0Bd26BF0aCP9qyJRlvdJ3j
|
|
|
|
4WBeX4ZmrveGrjMgkseSYc4xZ26sDHwfL351xjza
|
|
|
|
Lpipu\BGRrw17mWVBhuCExo476ri5tQFzbTc54VE
|
|
|
|
HYckxQ16CjSTibI5X69GmnYC9PNqEYq/1TP+HF10
|
|
|
|
Comment: John's Key
|
|
|
|
|
|
|
|
Key: ssh-rsa
|
|
|
|
Blob: AAAAB3NzaHVt6VqSGd5C1yc2EAAAABIwA232dnJA
|
|
|
|
AIEA5HVt6VqSGd5PTrLRdjNONxX/1TP+HF1HVt6V
|
|
|
|
qSGd50H1tVFGn0BB3NzaC1yc2EAd26BF0aCP9qyJ
|
|
|
|
RlvdJ3j4WBeX4ZmrveGrjMgkseSYc4xZ26HVt6Vq
|
|
|
|
SGd5sDHwfL351xjzaLpipu\BGB3NzaC1yc2EA/1T
|
|
|
|
Comment: Alice's Key
|
|
|
|
|
|
|
|
]]>
|
|
|
|
</screen>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2007-06-15 00:16:47 +00:00
|
|
|
<refsect1 role="notes">
|
|
|
|
&reftitle.notes;
|
|
|
|
¬e.ssh2.subsystem.publickey;
|
|
|
|
</refsect1>
|
|
|
|
|
2005-07-21 21:37:49 +00:00
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>ssh2_publickey_init</function></member>
|
|
|
|
<member><function>ssh2_publickey_add</function></member>
|
2005-07-22 19:34:25 +00:00
|
|
|
<member><function>ssh2_publickey_remove</function></member>
|
2005-07-21 21:37:49 +00:00
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-06-15 00:16:47 +00:00
|
|
|
|
2005-07-21 21:37:49 +00:00
|
|
|
</refentry>
|
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
|
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|