1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-20 02:48:03 -05:00

Enable nullable

This commit is contained in:
Bernd Schoolmann 2025-06-05 15:35:32 +02:00
parent e7129315c7
commit 442cc2e9cf
No known key found for this signature in database
2 changed files with 10 additions and 4 deletions

View File

@ -258,6 +258,11 @@ public class User : ITableObject<Guid>, IStorableSubscriber, IRevisable, ITwoFac
public PublicKeyEncryptionKeyPairData GetPublicKeyEncryptionKeyPair()
{
if (string.IsNullOrWhiteSpace(PrivateKey) || string.IsNullOrWhiteSpace(PublicKey))
{
throw new InvalidOperationException("User public key encryption key pair is not fully initialized.");
}
return new PublicKeyEncryptionKeyPairData
{
WrappedPrivateKey = PrivateKey,

View File

@ -1,9 +1,10 @@
namespace Bit.Core.KeyManagement.Models.Data;
#nullable enable
public class PublicKeyEncryptionKeyPairData
{
public string WrappedPrivateKey { get; set; }
public string SignedPublicKey { get; set; }
[System.Obsolete("Use SignedPublicKey instead for new code, if it is not null.")]
public string PublicKey { get; set; }
public required string WrappedPrivateKey { get; set; }
public string? SignedPublicKey { get; set; }
public required string PublicKey { get; set; }
}