mirror of
https://github.com/bitwarden/server
synced 2026-02-05 19:23:25 +00:00
* Implement TDE v2 signup * Clean up fallback logic for account keys * Fix broken v2 logic * Add comment * Update comment
33 lines
1.2 KiB
C#
33 lines
1.2 KiB
C#
using Bit.Core.KeyManagement.Models.Api.Response;
|
|
using Bit.Core.KeyManagement.Models.Data;
|
|
using Bit.Core.Models.Api;
|
|
|
|
namespace Bit.Api.Models.Response;
|
|
|
|
public class KeysResponseModel : ResponseModel
|
|
{
|
|
public KeysResponseModel(UserAccountKeysData accountKeys, string? masterKeyWrappedUserKey)
|
|
: base("keys")
|
|
{
|
|
if (masterKeyWrappedUserKey != null)
|
|
{
|
|
Key = masterKeyWrappedUserKey;
|
|
}
|
|
|
|
PublicKey = accountKeys.PublicKeyEncryptionKeyPairData.PublicKey;
|
|
PrivateKey = accountKeys.PublicKeyEncryptionKeyPairData.WrappedPrivateKey;
|
|
AccountKeys = new PrivateKeysResponseModel(accountKeys);
|
|
}
|
|
|
|
/// <summary>
|
|
/// The master key wrapped user key. The master key can either be a master-password master key or a
|
|
/// key-connector master key.
|
|
/// </summary>
|
|
public string? Key { get; set; }
|
|
[Obsolete("Use AccountKeys.PublicKeyEncryptionKeyPair.PublicKey instead")]
|
|
public string PublicKey { get; set; }
|
|
[Obsolete("Use AccountKeys.PublicKeyEncryptionKeyPair.WrappedPrivateKey instead")]
|
|
public string PrivateKey { get; set; }
|
|
public PrivateKeysResponseModel AccountKeys { get; set; }
|
|
}
|