2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
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-add">
|
2005-07-21 21:37:49 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>ssh2_publickey_add</refname>
|
|
|
|
<refpurpose>
|
|
|
|
Add an authorized publickey
|
|
|
|
</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>bool</type><methodname>ssh2_publickey_add</methodname>
|
|
|
|
<methodparam><type>resource</type><parameter>pkey</parameter></methodparam>
|
|
|
|
<methodparam><type>string</type><parameter>algoname</parameter></methodparam>
|
|
|
|
<methodparam><type>string</type><parameter>blob</parameter></methodparam>
|
2009-01-19 15:05:01 +00:00
|
|
|
<methodparam choice="opt"><type>bool</type><parameter>overwrite</parameter><initializer>false</initializer></methodparam>
|
2005-07-21 21:37:49 +00:00
|
|
|
<methodparam choice="opt"><type>array</type><parameter>attributes</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
|
|
|
|
|
|
|
¬e.ssh2.subsystem.publickey;
|
|
|
|
|
|
|
|
</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 created by <function>ssh2_publickey_init</function>.
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>algoname</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2005-07-24 05:44:27 +00:00
|
|
|
Publickey algorithm (e.g.): ssh-dss, ssh-rsa
|
2005-07-21 21:37:49 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>blob</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
2005-07-24 05:44:27 +00:00
|
|
|
Publickey blob as raw binary data
|
2005-07-21 21:37:49 +00:00
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>overwrite</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
If the specified key already exists, should it be overwritten?
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>attributes</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
Associative array of attributes to assign to this public key.
|
|
|
|
Refer to ietf-secsh-publickey-subsystem for a list of supported attributes.
|
2006-03-20 13:33:16 +00:00
|
|
|
To mark an attribute as mandatory, precede its name with an asterisk.
|
2005-07-21 21:37:49 +00:00
|
|
|
If the server is unable to support an attribute marked mandatory,
|
|
|
|
it will abort the add process.
|
|
|
|
</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;
|
2005-07-24 05:44:27 +00:00
|
|
|
<para>
|
|
|
|
&return.success;
|
|
|
|
</para>
|
2005-07-21 21:37:49 +00:00
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Adding a publickey with <function>ssh2_publickey_add</function></title>
|
|
|
|
<programlisting role="php">
|
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$ssh2 = ssh2_connect('shell.example.com', 22);
|
|
|
|
ssh2_auth_password($ssh2, 'jdoe', 'password');
|
|
|
|
$pkey = ssh2_publickey_init($ssh2);
|
|
|
|
|
|
|
|
$keyblob = base64_decode('
|
|
|
|
AAAAB3NzaC1yc2EAAAABIwAAAIEA5HVt6VqSGd5PTrLRdjNONxXH1tVFGn0
|
|
|
|
Bd26BF0aCP9qyJRlvdJ3j4WBeX4ZmrveGrjMgkseSYc4xZ26sDHwfL351xj
|
|
|
|
zaLpipu\BGRrw17mWVBhuCExo476ri5tQFzbTc54VEHYckxQ16CjSTibI5X
|
|
|
|
69GmnYC9PNqEYq/1TP+HF10=');
|
|
|
|
|
2009-03-24 10:54:11 +00:00
|
|
|
ssh2_publickey_add($pkey, 'ssh-rsa', $keyblob, false, array('comment'=>"John's Key"));
|
2005-07-21 21:37:49 +00:00
|
|
|
?>
|
|
|
|
]]>
|
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>ssh2_publickey_init</function></member>
|
2005-07-22 19:34:25 +00:00
|
|
|
<member><function>ssh2_publickey_remove</function></member>
|
|
|
|
<member><function>ssh2_publickey_list</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
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2005-07-21 21:37:49 +00:00
|
|
|
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
|
|
|
|
-->
|