Files
laatzen/Common/Hardware/WaterMeter/Genesis/GenesisPwd/MeterPwdDb.cs
T

86 lines
2.6 KiB
C#

using System;
using System.Collections.Generic;
namespace Xylem.Common.Hardware.WaterMeter.Genesis.GenesisPwd
{
/// <summary>
/// DB contents of:
/// - passwords,
/// - password-hashes (12 char from password - SHA1),
/// - Order number,
/// - Radio address,
/// - Key set id,
/// - Password file id and
/// - Skeleton key.
/// </summary>
public class MeterPwdDb
{
/// <summary>
/// 8 passwords needed for clear the text passwords ans the password file
/// </summary>
public const Int32 PwdLevels = 8;
/// <summary>
/// Each password will generate a 20 bytes hash constant due to SHA1 algorithm
/// </summary>
private const Int32 HashedPwdLength = 20;
/// <summary>
/// password file length is 160 bytes (8 passwords a 20 bytes hashed)
/// </summary>
public const Int32 PwdFileLength = PwdLevels * HashedPwdLength;
/// <summary>
/// 8 passwords needed for the password file
/// </summary>
public const Int32 ClearTextPwdLength = 12;
/// <summary>
/// Skeleton key index in password list.
/// </summary>
public const Int32 SkeletonKeyIdx = 2;
/// <summary>
/// Password Level 8 index in 8 elements password list.
/// </summary>
public const Int32 PwdLevel8Idx = 7;
/// <summary>
/// Order number for this Genesis.
/// </summary>
public Int64? OrderNumber = null;
/// <summary>
/// Optional radio address.
/// </summary>
public Int64? RadioAddress = null;
/// <summary>
/// Skeleton key for login if password file is not installed.
/// </summary>
public String Skeleton = "";
/// <summary>
/// Password, which is the Skeleton, if password file not installed, or the PwdLevel8, if the password file is installed .
/// </summary>
public String Password = "";
/// <summary>
/// List of hashes.
/// </summary>
public List<Byte[]> ListOfHashes = new List<Byte[]>();
/// <summary>
/// List of passwords.
/// </summary>
public List<Byte[]> ListOfPasswords = new List<Byte[]>();
/// <summary>
/// Ident for password server (BSI) can be radio address or pcbid
/// </summary>
public String PasswordFileIdent { get; set; }
/// <summary>
/// Ident from password server (BSI)
/// </summary>
public String KeySetId { get; set; }
}
}