mirror of
https://github.com/bitwarden/server.git
synced 2025-06-07 11:40:31 -05:00
Enable nullable
This commit is contained in:
parent
fa2e314c4f
commit
a33bf793e1
@ -1,5 +1,6 @@
|
||||
#nullable enable
|
||||
|
||||
using System.Text.Json.Serialization;
|
||||
using Bit.Core.Enums;
|
||||
|
||||
namespace Bit.Core.KeyManagement.Models.Data;
|
||||
@ -9,4 +10,13 @@ public class SignatureKeyPairData
|
||||
public required SignatureAlgorithm SignatureAlgorithm { get; set; }
|
||||
public required string WrappedSigningKey { get; set; }
|
||||
public required string VerifyingKey { get; set; }
|
||||
|
||||
[JsonConstructor]
|
||||
[System.Diagnostics.CodeAnalysis.SetsRequiredMembersAttribute]
|
||||
public SignatureKeyPairData(SignatureAlgorithm signatureAlgorithm, string wrappedSigningKey, string verifyingKey)
|
||||
{
|
||||
SignatureAlgorithm = signatureAlgorithm;
|
||||
WrappedSigningKey = wrappedSigningKey ?? throw new ArgumentNullException(nameof(wrappedSigningKey));
|
||||
VerifyingKey = verifyingKey ?? throw new ArgumentNullException(nameof(verifyingKey));
|
||||
}
|
||||
}
|
||||
|
@ -25,12 +25,11 @@ public class UserSignatureKeyPairRepository : Repository<Core.KeyManagement.Enti
|
||||
return null;
|
||||
}
|
||||
|
||||
return new SignatureKeyPairData
|
||||
{
|
||||
SignatureAlgorithm = signingKeys.SignatureAlgorithm,
|
||||
WrappedSigningKey = signingKeys.SigningKey,
|
||||
VerifyingKey = signingKeys.VerifyingKey,
|
||||
};
|
||||
return new SignatureKeyPairData(
|
||||
signingKeys.SignatureAlgorithm,
|
||||
signingKeys.SigningKey,
|
||||
signingKeys.VerifyingKey
|
||||
);
|
||||
}
|
||||
|
||||
public UpdateEncryptedDataForKeyRotation SetUserSignatureKeyPair(Guid userId, SignatureKeyPairData signingKeys)
|
||||
|
Loading…
x
Reference in New Issue
Block a user