1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-20 02:48:03 -05:00
bitwarden/src/Api/KeyManagement/Models/Response/PublicKeysResponseModel.cs
Bernd Schoolmann d860bdc401
Fix build
2025-06-06 19:29:41 +02:00

35 lines
1.2 KiB
C#

using Bit.Core.KeyManagement.Models.Data.Models;
using Bit.Core.Models.Api;
namespace Bit.Api.KeyManagement.Models.Response;
#nullable enable
/// <summary>
/// This response model is used to return the public keys of a user, to any other registered user or entity on the server.
/// It can contain public keys (signature/encryption), and proofs between the two. It does not contain (encrypted) private keys.
/// </summary>
public class PublicKeysResponseModel : ResponseModel
{
[System.Diagnostics.CodeAnalysis.SetsRequiredMembersAttribute]
public PublicKeysResponseModel(UserAccountKeysData accountKeys)
: base("publicKeys")
{
PublicKey = accountKeys.PublicKeyEncryptionKeyPairData.PublicKey;
if (accountKeys == null)
{
throw new ArgumentNullException(nameof(accountKeys));
}
if (accountKeys.SignatureKeyPairData != null)
{
SignedPublicKey = accountKeys.PublicKeyEncryptionKeyPairData.SignedPublicKey;
VerifyingKey = accountKeys.SignatureKeyPairData.VerifyingKey;
}
}
public string? VerifyingKey { get; set; }
public string? SignedPublicKey { get; set; }
public required string PublicKey { get; set; }
}