Class KeyHostAlgorithm
- Namespace
- Renci.SshNet.Security
- Assembly
- Renci.SshNet.dll
Implements key support for host algorithm.
public class KeyHostAlgorithm : HostAlgorithm
Inheritance
Derived
Inherited Members
Constructors
KeyHostAlgorithm(string, Key)
Initializes a new instance of the Renci.SshNet.Security.KeyHostAlgorithm class.
public KeyHostAlgorithm(string name, Key key)
Parameters
KeyHostAlgorithm(string, Key, DigitalSignature)
Initializes a new instance of the Renci.SshNet.Security.KeyHostAlgorithm class.
public KeyHostAlgorithm(string name, Key key, DigitalSignature digitalSignature)
Parameters
name
string-
The signature format identifier.
key
Key-
The key used in this host key algorithm.
digitalSignature
DigitalSignature-
The signature implementation used in this host key algorithm.
Remarks
The key used by digitalSignature
is intended to be equal to key
.
This is not verified.
Properties
Data
Gets the encoded public key data.
public override byte[] Data { get; }
Property Value
- byte[]
DigitalSignature
Gets the signature implementation used in this host key algorithm.
public DigitalSignature DigitalSignature { get; }
Property Value
Key
Gets the key used in this host key algorithm.
public Key Key { get; }
Property Value
Methods
Sign(byte[])
Signs and encodes the specified data.
public override byte[] Sign(byte[] data)
Parameters
data
byte[]-
The data to be signed.
Returns
- byte[]
-
The encoded signature.
VerifySignature(byte[], byte[])
Verifies the encoded signature.
public override bool VerifySignature(byte[] data, byte[] signature)
Parameters
data
byte[]-
The data to verify the signature against.
signature
byte[]-
The encoded signature data, as the signature format identifier followed by the signature blob.
Returns
- bool
-
true if
signature
is the result of signing and encodingdata
with the corresponding private key to Renci.SshNet.Security.KeyHostAlgorithm.Key.
Remarks
See https://datatracker.ietf.org/doc/html/rfc4253#section-6.6.