| | | 1 | | namespace LOCKnet.Core.DataAbstractions; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Credential-Datensatz wie er aus der Datenbank kommt. |
| | | 5 | | /// Das Passwort ist immer verschlüsselt — Entschlüsselung passiert im Core-Service. |
| | | 6 | | /// </summary> |
| | | 7 | | public class CredentialRecord |
| | | 8 | | { |
| | | 9 | | /// <summary>Eindeutige Datenbank-ID des Eintrags.</summary> |
| | 499 | 10 | | public int Id { get; set; } |
| | | 11 | | /// <summary>Bezeichnung des Eintrags (z.B. "GitHub", "E-Mail").</summary> |
| | 1075 | 12 | | public string Title { get; set; } = string.Empty; |
| | | 13 | | /// <summary>Optionaler Benutzername oder E-Mail-Adresse.</summary> |
| | 720 | 14 | | public string? Username { get; set; } |
| | | 15 | | /// <summary>AES-256-GCM-verschlüsseltes Passwort als Byte-Array. Niemals Klartext.</summary> |
| | 1068 | 16 | | public byte[] EncryptedPassword { get; set; } = []; |
| | | 17 | | /// <summary>Versioniert verschluesselte Credential-Metadaten als Byte-Array.</summary> |
| | 1132 | 18 | | public byte[] EncryptedMetadata { get; set; } = []; |
| | | 19 | | /// <summary>Stabile GUID fuer AAD-Bindung und Record-Swap-Schutz.</summary> |
| | 1313 | 20 | | public string CredentialUuid { get; set; } = string.Empty; |
| | | 21 | | /// <summary>Versionsmarker des gespeicherten Secret-Envelopes.</summary> |
| | 1059 | 22 | | public int SecretFormatVersion { get; set; } = CredentialSecretFormatVersion.Legacy; |
| | | 23 | | /// <summary>Versionsmarker des gespeicherten Metadaten-Envelopes.</summary> |
| | 1090 | 24 | | public int MetadataFormatVersion { get; set; } = CredentialMetadataFormatVersion.Legacy; |
| | | 25 | | /// <summary>Optionale URL des zugehörigen Dienstes.</summary> |
| | 669 | 26 | | public string? Url { get; set; } |
| | | 27 | | /// <summary>Optionale Freitextnotizen zum Eintrag.</summary> |
| | 662 | 28 | | public string? Notes { get; set; } |
| | | 29 | | /// <summary>UTC-Zeitstempel der Erstellung (von SQLite gesetzt).</summary> |
| | 421 | 30 | | public DateTime CreatedAt { get; set; } |
| | | 31 | | /// <summary>UTC-Zeitstempel der letzten Änderung (von SQLite gesetzt).</summary> |
| | 420 | 32 | | public DateTime UpdatedAt { get; set; } |
| | | 33 | | /// <summary>Optionaler Icon-Schluessel fuer Material-Icon-Darstellung.</summary> |
| | 660 | 34 | | public string? IconKey { get; set; } |
| | | 35 | | /// <summary>Typ des Credentials (Passwort oder API-Schlüssel). Standard: Password für Abwärtskompatibilität.</summary |
| | 1053 | 36 | | public CredentialType CredentialType { get; set; } = CredentialType.Password; |
| | | 37 | | } |