We discourage use of this function as of libssh2 1.2.5. Instead we strongly urge users to use
libssh2_knownhost_addc(3) instead, which as a more complete API. libssh2_knownhost_add(3) is subject for
removal in a future release.
Adds a known host to the collection of known hosts identified by the 'hosts' handle.
host is a pointer the host name in plain text or hashed. If hashed, it must be provided base64 encoded.
The host name can be the IP numerical address of the host or the full name.
saltPisapointertothesaltusedforthehosthashing,ifthehostisprovidedhashed.Ifthehostisprovidedinplaintext,salthasnomeaning.Thesalthastobeprovidedbase64encodedwithatrailingzerobyte.keyisapointertothekeyforthegivenhost.keylenisthetotalsizeinbytesofthekeypointedtobythekeyargumenttypemaskisabitmaskthatspecifiesformatandinfoaboutthedatapassedtothisfunction.Specifically,itdetailswhatformatthehostnameis,whatformatthekeyisandwhatkeytypeitis.Thehostnameisgivenasoneofthefollowingtypes:LIBSSH2_KNOWNHOST_TYPE_PLAIN,LIBSSH2_KNOWNHOST_TYPE_SHA1orLIBSSH2_KNOWNHOST_TYPE_CUSTOM.Thekeyisencodedusingoneofthefollowingencodings:LIBSSH2_KNOWNHOST_KEYENC_RAWorLIBSSH2_KNOWNHOST_KEYENC_BASE64.Thekeyisusingoneofthesealgorithms:LIBSSH2_KNOWNHOST_KEY_RSA1,LIBSSH2_KNOWNHOST_KEY_SSHRSAorLIBSSH2_KNOWNHOST_KEY_SSHDSS(deprecated).storeshouldpointtoapointerthatgetsfilledintopointtotheknownhostdataaftertheaddition.NULLcanbepassedifyoudonotcareaboutthispointer.