Esempio n. 1
0
        public static unsafe int ssh_get_publickey_hash(SshKeyHandle key, PublicKeyHashType type, out byte[] hash)
        {
            IntPtr pHash;
            nuint  length;
            int    rv = ssh_get_publickey_hash(key, type, &pHash, &length);

            if (rv == SSH_OK)
            {
                hash = new byte[length];
                new Span <byte>((void *)pHash, (int)length).CopyTo(hash);
                ssh_clean_pubkey_hash(&pHash);
            }
            else
            {
                hash = Array.Empty <byte>();
            }
            return(rv);
        }
Esempio n. 2
0
 public static extern AuthResult ssh_userauth_publickey(SessionHandle session, string?username, SshKeyHandle privkey);
Esempio n. 3
0
 private static unsafe extern int ssh_get_publickey_hash(SshKeyHandle key, PublicKeyHashType type, IntPtr *hash, nuint *hlen);