.TH ssh_client_key_api 3erl "ssh 3.0.5" "Ericsson AB" "Erlang Module Definition" .SH NAME ssh_client_key_api \- -behaviour(ssh_client_key_api). .SH DESCRIPTION .LP Behavior describing the API for an SSH client\&'s public key handling\&. By implementing the callbacks defined\&. in this behavior it is possible to customize the SSH client\&'s public key handling\&. By default the SSH application implements this behavior with help of the standard openssh files, see \fB ssh(7)\fR\&\&. .SH "DATA TYPES " .LP Type definitions that are used more than once in this module and/or abstractions to indicate the intended use of the data type\&. For more details on public key data types see the \fB public_key user\&'s guide\&.\fR\& .LP boolean() = true | false .LP string() = [byte()] .LP public_key() = #\&'RSAPublicKey\&'{}| {integer(), #\&'Dss-Parms\&'{}}| term() .LP private_key() = #\&'RSAPrivateKey\&'{} | #\&'DSAPrivateKey\&'{} | term() .LP public_key_algorithm() = \&'ssh-rsa\&'| \&'ssh-dss\&' | atom() .SH EXPORTS .LP .B Module:add_host_key(HostNames, Key, ConnectOptions) -> ok | {error, Reason} .br .RS .LP Types: .RS 3 HostNames = string() .br .RS 2 Description of the host that owns the \fIPublicKey\fR\& .RE Key = public_key() .br .RS 2 Normally an RSA or DSA public key but handling of other public keys can be added .RE ConnectOptions = proplists:proplist() .br .RS 2 Options provided to \fBssh:connect/[3,4]\fR\& .RE Reason = term() .br .RE .RE .RS .LP Adds a host key to the set of trusted host keys .RE .LP .B Module:is_host_key(Key, Host, Algorithm, ConnectOptions) -> Result .br .RS .LP Types: .RS 3 Key = public_key() .br .RS 2 Normally an RSA or DSA public key but handling of other public keys can be added .RE Host = string() .br .RS 2 Description of the host .RE Algorithm = public_key_algorithm() .br .RS 2 Host key algorithm\&. Should support \&'ssh-rsa\&'| \&'ssh-dss\&' but additional algorithms can be handled\&. .RE ConnectOptions = proplists:proplist() .br .RS 2 Options provided to \fBssh:connect/[3,4]\fR\& .RE Result = boolean() .br .RE .RE .RS .LP Checks if a host key is trusted .RE .LP .B Module:user_key(Algorithm, ConnectOptions) -> {ok, PrivateKey} | {error, Reason} .br .RS .LP Types: .RS 3 Algorithm = public_key_algorithm() .br .RS 2 Host key algorithm\&. Should support \&'ssh-rsa\&'| \&'ssh-dss\&' but additional algorithms can be handled\&. .RE ConnectOptions = proplists:proplist() .br .RS 2 Options provided to \fBssh:connect/[3,4]\fR\& .RE PrivateKey = private_key() .br .RS 2 The private key of the user matching the \fIAlgorithm\fR\& .RE Reason = term() .br .RE .RE .RS .LP Fetches the users "public key" matching the \fIAlgorithm\fR\&\&. .LP .RS -4 .B Note: .RE The private key contains the public key .RE