mirror of
https://github.com/bitwarden/server.git
synced 2026-01-31 14:13:18 +08:00
Main fix: only assign new key value where old keys are not set and new keys have been provided. Refactors: - use consistent DTO model for keypairs - delete duplicate property assignment for new orgs
24 lines
776 B
C#
24 lines
776 B
C#
// FIXME: Update this file to be null safe and then delete the line below
|
|
#nullable disable
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
using Bit.Core.KeyManagement.Models.Data;
|
|
|
|
namespace Bit.Api.Billing.Models.Requests;
|
|
|
|
// ReSharper disable once ClassNeverInstantiated.Global
|
|
public class KeyPairRequestBody
|
|
{
|
|
[Required(ErrorMessage = "'publicKey' must be provided")]
|
|
public string PublicKey { get; set; }
|
|
[Required(ErrorMessage = "'encryptedPrivateKey' must be provided")]
|
|
public string EncryptedPrivateKey { get; set; }
|
|
|
|
public PublicKeyEncryptionKeyPairData ToPublicKeyEncryptionKeyPairData()
|
|
{
|
|
return new PublicKeyEncryptionKeyPairData(
|
|
wrappedPrivateKey: EncryptedPrivateKey,
|
|
publicKey: PublicKey);
|
|
}
|
|
}
|