Skip to content

Commit

Permalink
Merge branch 'main' into test-on-dev-node
Browse files Browse the repository at this point in the history
  • Loading branch information
BitcoinWukong committed Dec 17, 2023
2 parents 246a273 + abe55c8 commit afd1469
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import org.json.JSONObject
import java.io.IOException

fun errorRobot(token: String, errorMessage: String): Robot {
return Robot(
Expand Down Expand Up @@ -78,6 +79,8 @@ data class Robot(
robot.privateKeyBundle = PgpKeyManager.waitForDecryption(encryptedKey)
if (robot.privateKeyBundle != null) {
onPrivateKeyDecrypted(robot)
} else {
throw IOException("Unable to decrypt private key for robot")
}
}
}
Expand All @@ -95,6 +98,11 @@ data class Robot(
"Robot", "Robot $token pgpPrivateKey is null, continue the private key decryption"
)
privateKeyBundle = PgpKeyManager.waitForDecryption(encryptedPrivateKey!!)
if (privateKeyBundle != null) {
onPrivateKeyDecrypted(this)
} else {
throw IOException("Unable to decrypt private key for robot")
}
}

messageData.message = PgpKeyGenerator.decryptMessage(
Expand Down

0 comments on commit afd1469

Please sign in to comment.