From dbb4aca1e29702ed16cdf166ff1fb975e67f99d0 Mon Sep 17 00:00:00 2001 From: Bernd Schoolmann Date: Mon, 16 Jun 2025 11:32:00 +0200 Subject: [PATCH] Fix cases for request data conversion --- .../Requests/AccountKeysRequestModel.cs | 20 ++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Api/KeyManagement/Models/Requests/AccountKeysRequestModel.cs b/src/Api/KeyManagement/Models/Requests/AccountKeysRequestModel.cs index f9d6603a6b..06e44d88f8 100644 --- a/src/Api/KeyManagement/Models/Requests/AccountKeysRequestModel.cs +++ b/src/Api/KeyManagement/Models/Requests/AccountKeysRequestModel.cs @@ -15,7 +15,7 @@ public class AccountKeysRequestModel public UserAccountKeysData ToAccountKeysData() { // This will be cleaned up, after a compatibility period, at which point PublicKeyEncryptionKeyPair and SignatureKeyPair will be required. - if (PublicKeyEncryptionKeyPair == null || SignatureKeyPair == null) + if (PublicKeyEncryptionKeyPair == null) { return new UserAccountKeysData { @@ -28,11 +28,21 @@ public class AccountKeysRequestModel } else { - return new UserAccountKeysData + if (SignatureKeyPair == null) { - PublicKeyEncryptionKeyPairData = PublicKeyEncryptionKeyPair.ToPublicKeyEncryptionKeyPairData(), - SignatureKeyPairData = SignatureKeyPair.ToSignatureKeyPairData() - }; + return new UserAccountKeysData + { + PublicKeyEncryptionKeyPairData = PublicKeyEncryptionKeyPair.ToPublicKeyEncryptionKeyPairData(), + }; + } + else + { + return new UserAccountKeysData + { + PublicKeyEncryptionKeyPairData = PublicKeyEncryptionKeyPair.ToPublicKeyEncryptionKeyPairData(), + SignatureKeyPairData = SignatureKeyPair.ToSignatureKeyPairData() + }; + } } } }