1
0
mirror of https://github.com/bitwarden/server.git synced 2025-04-06 21:48:12 -05:00
bitwarden/src/Api/Models/Request/Accounts/KeysRequestModel.cs

24 lines
545 B
C#

using Bit.Core.Domains;
using System.ComponentModel.DataAnnotations;
namespace Bit.Api.Models
{
public class KeysRequestModel
{
public string PublicKey { get; set; }
[Required]
public string PrivateKey { get; set; }
public User ToUser(User existingUser)
{
if(!string.IsNullOrWhiteSpace(PublicKey))
{
existingUser.PublicKey = PublicKey;
}
existingUser.PrivateKey = PrivateKey;
return existingUser;
}
}
}