namespace DnsClient.Protocol
{
///
/// A represending an SSH fingerprint
///
/// SSHFP RRs are used to hold SSH fingerprints. Upon connecting to a
/// host an SSH client may choose to query for this to check the fingerprint(s)
///
///
/// RFC 4255
/// RFC 6594
/// RFC 7479
public class SshfpRecord : DnsResourceRecord
{
///
///
///
/// The information.
/// The algorithm.
/// The fingerprint type.
/// The fingerprint.
public SshfpRecord(ResourceRecordInfo info, SshfpAlgorithm algorithm, SshfpFingerprintType fingerprintType, string fingerprint) : base(info)
{
Algorithm = algorithm;
FingerprintType = fingerprintType;
Fingerprint = fingerprint;
}
///
/// Algorithm used for the fingerprint
///
public SshfpAlgorithm Algorithm { get; }
///
/// Fingerprint type used for the fingerprint
///
public SshfpFingerprintType FingerprintType { get; }
///
/// Fingerprint as defined in the RR
///
public string Fingerprint { get; }
private protected override string RecordToString()
{
return $"{(int)Algorithm} {(int)FingerprintType} {Fingerprint}";
}
}
///
/// Algorithm used by
///
public enum SshfpAlgorithm
{
///
/// Reserved for later use
///
Reserved = 0,
///
/// RSA
///
RSA = 1,
///
/// DSS
///
DSS = 2,
///
/// Eliptic Curve DSA
///
ECDSA = 3,
///
/// Edwards-curve DSA
///
Ed25519 = 4,
}
///
/// Fingerprint type used by
///
public enum SshfpFingerprintType
{
///
/// Reserved for later use
///
Reserved = 0,
///
/// SHA-1 fingerprint
///
SHA1 = 1,
///
/// SHA-256 fingerprint
///
SHA256 = 2,
}
}