mirror of
https://github.com/bitwarden/server.git
synced 2025-06-20 02:48:03 -05:00
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using Bit.Core.KeyManagement.Models.Data;
|
|
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")
|
|
{
|
|
ArgumentNullException.ThrowIfNull(accountKeys);
|
|
PublicKey = accountKeys.PublicKeyEncryptionKeyPairData.PublicKey;
|
|
|
|
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; }
|
|
}
|