mirror of
https://github.com/bitwarden/server
synced 2026-01-28 23:36:12 +00: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
23 lines
644 B
C#
23 lines
644 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.AdminConsole.Models.Request.Organizations;
|
|
|
|
public class OrganizationKeysRequestModel
|
|
{
|
|
[Required]
|
|
public string PublicKey { get; set; }
|
|
[Required]
|
|
public string EncryptedPrivateKey { get; set; }
|
|
|
|
public PublicKeyEncryptionKeyPairData ToPublicKeyEncryptionKeyPairData()
|
|
{
|
|
return new PublicKeyEncryptionKeyPairData(
|
|
wrappedPrivateKey: EncryptedPrivateKey,
|
|
publicKey: PublicKey);
|
|
}
|
|
}
|