mirror of
https://github.com/bitwarden/server.git
synced 2025-06-20 02:48:03 -05:00
Cleanup
This commit is contained in:
parent
90ef67b05c
commit
ccf1ffa90f
@ -1,23 +1,34 @@
|
||||
using Bit.Core.Models.Api;
|
||||
using Bit.Core.KeyManagement.Models.Data;
|
||||
using Bit.Core.Models.Api;
|
||||
|
||||
namespace Bit.Api.KeyManagement.Models.Response;
|
||||
|
||||
#nullable enable
|
||||
|
||||
/// <summary>
|
||||
/// This response model is used to return the public keys of a user, to any other registered user or entity on the server.
|
||||
/// It can contain public keys (signature/encryption), and proofs between the two. It does not contain (encrypted) private keys.
|
||||
/// </summary>
|
||||
public class PublicKeysResponseModel : ResponseModel
|
||||
{
|
||||
public PublicKeysResponseModel(string verifyingKey, string publicKey, string signedPublicKey)
|
||||
public PublicKeysResponseModel(UserAccountKeysData accountKeys)
|
||||
: base("publicKeys")
|
||||
{
|
||||
VerifyingKey = verifyingKey;
|
||||
SignedPublicKey = signedPublicKey;
|
||||
PublicKey = publicKey;
|
||||
if (accountKeys == null)
|
||||
{
|
||||
throw new ArgumentNullException(nameof(accountKeys));
|
||||
}
|
||||
|
||||
if (accountKeys.SignatureKeyPairData != null)
|
||||
{
|
||||
SignedPublicKey = accountKeys.PublicKeyEncryptionKeyPairData.SignedPublicKey;
|
||||
VerifyingKey = accountKeys.SignatureKeyPairData.VerifyingKey;
|
||||
}
|
||||
PublicKey = accountKeys.PublicKeyEncryptionKeyPairData.PublicKey;
|
||||
}
|
||||
|
||||
public string VerifyingKey { get; set; }
|
||||
public string SignedPublicKey { get; set; }
|
||||
[System.Obsolete("Use SignedPublicKey for new code.")]
|
||||
public string PublicKey { get; set; }
|
||||
public string? VerifyingKey { get; set; }
|
||||
public string? SignedPublicKey { get; set; }
|
||||
[System.Obsolete("Use SignedPublicKey for new code, if it is not null.")]
|
||||
public required string PublicKey { get; set; }
|
||||
}
|
||||
|
@ -4,6 +4,6 @@ public class PublicKeyEncryptionKeyPairData
|
||||
{
|
||||
public string WrappedPrivateKey { get; set; }
|
||||
public string SignedPublicKey { get; set; }
|
||||
[System.Obsolete("Use SignedPublicKey instead for new code.")]
|
||||
[System.Obsolete("Use SignedPublicKey instead for new code, if it is not null.")]
|
||||
public string PublicKey { get; set; }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user