mirror of
https://github.com/bitwarden/server.git
synced 2025-06-20 10:58:07 -05:00
Enable nullable
This commit is contained in:
parent
e7129315c7
commit
442cc2e9cf
@ -258,6 +258,11 @@ public class User : ITableObject<Guid>, IStorableSubscriber, IRevisable, ITwoFac
|
|||||||
|
|
||||||
public PublicKeyEncryptionKeyPairData GetPublicKeyEncryptionKeyPair()
|
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
|
return new PublicKeyEncryptionKeyPairData
|
||||||
{
|
{
|
||||||
WrappedPrivateKey = PrivateKey,
|
WrappedPrivateKey = PrivateKey,
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
namespace Bit.Core.KeyManagement.Models.Data;
|
namespace Bit.Core.KeyManagement.Models.Data;
|
||||||
|
|
||||||
|
#nullable enable
|
||||||
|
|
||||||
public class PublicKeyEncryptionKeyPairData
|
public class PublicKeyEncryptionKeyPairData
|
||||||
{
|
{
|
||||||
public string WrappedPrivateKey { get; set; }
|
public required string WrappedPrivateKey { get; set; }
|
||||||
public string SignedPublicKey { get; set; }
|
public string? SignedPublicKey { get; set; }
|
||||||
[System.Obsolete("Use SignedPublicKey instead for new code, if it is not null.")]
|
public required string PublicKey { get; set; }
|
||||||
public string PublicKey { get; set; }
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user