| | | 1 | | namespace Renci.SshNet.Security |
| | | 2 | | { |
| | | 3 | | /// <summary> |
| | | 4 | | /// Base class for SSH host algorithms. |
| | | 5 | | /// </summary> |
| | | 6 | | public abstract class HostAlgorithm |
| | | 7 | | { |
| | | 8 | | /// <summary> |
| | | 9 | | /// Gets the host key name. |
| | | 10 | | /// </summary> |
| | 6255 | 11 | | public string Name { get; private set; } |
| | | 12 | | |
| | | 13 | | /// <summary> |
| | | 14 | | /// Gets the host key data. |
| | | 15 | | /// </summary> |
| | | 16 | | public abstract byte[] Data { get; } |
| | | 17 | | |
| | | 18 | | /// <summary> |
| | | 19 | | /// Initializes a new instance of the <see cref="HostAlgorithm"/> class. |
| | | 20 | | /// </summary> |
| | | 21 | | /// <param name="name">The host key name.</param> |
| | 2821 | 22 | | protected HostAlgorithm(string name) |
| | 2821 | 23 | | { |
| | 2821 | 24 | | Name = name; |
| | 2821 | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <summary> |
| | | 28 | | /// Signs the specified data. |
| | | 29 | | /// </summary> |
| | | 30 | | /// <param name="data">The data.</param> |
| | | 31 | | /// <returns>Signed data.</returns> |
| | | 32 | | public abstract byte[] Sign(byte[] data); |
| | | 33 | | |
| | | 34 | | /// <summary> |
| | | 35 | | /// Verifies the signature. |
| | | 36 | | /// </summary> |
| | | 37 | | /// <param name="data">The data.</param> |
| | | 38 | | /// <param name="signature">The signature.</param> |
| | | 39 | | /// <returns><see langword="true"/> is signature was successfully verifies; otherwise <see langword="false"/>.</ |
| | | 40 | | public abstract bool VerifySignature(byte[] data, byte[] signature); |
| | | 41 | | } |
| | | 42 | | } |