-
Notifications
You must be signed in to change notification settings - Fork 719
/
ssh2-publickey-list.xml
162 lines (150 loc) · 3.93 KB
/
ssh2-publickey-list.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="function.ssh2-publickey-list">
<refnamediv>
<refname>ssh2_publickey_list</refname>
<refpurpose>
List currently authorized publickeys
</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>ssh2_publickey_list</methodname>
<methodparam><type>resource</type><parameter>pkey</parameter></methodparam>
</methodsynopsis>
<para>
List currently authorized publickeys.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>pkey</parameter></term>
<listitem>
<para>
Publickey Subsystem resource
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns a numerically indexed array of keys,
each of which is an associative array containing:
name, blob, and attrs elements.
</para>
<para>
<table>
<title>Publickey elements</title>
<tgroup cols="2">
<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:
<literal>ssh-dss</literal> or <literal>ssh-rsa</literal>.</entry>
</row>
<row>
<entry>blob</entry>
<entry>Publickey blob as raw binary data.</entry>
</row>
<row>
<entry>attrs</entry>
<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>
</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>
<refsect1 role="notes">
&reftitle.notes;
¬e.ssh2.subsystem.publickey;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ssh2_publickey_init</function></member>
<member><function>ssh2_publickey_add</function></member>
<member><function>ssh2_publickey_remove</function></member>
</simplelist>
</para>
</refsect1>
</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:"~/.phpdoc/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
-->