Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions umaserverdemo/src/main/kotlin/com/lightspark/PubKeyHandler.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ suspend fun handlePubKeyRequest(call: ApplicationCall, config: UmaConfig): Strin
val twoWeeksFromNowMs = System.currentTimeMillis() + 1000 * 60 * 60 * 24 * 14

val response = PubKeyResponse(
signingPubKey = config.umaSigningPubKey,
encryptionPubKey = config.umaEncryptionPubKey,
expirationTimestamp = twoWeeksFromNowMs / 1000,
signingCert = config.umaSigningCertificate,
encryptionCert = config.umaEncryptionCertificate,
expirationTs = twoWeeksFromNowMs / 1000,
)

call.respond(response)
Expand Down
7 changes: 7 additions & 0 deletions umaserverdemo/src/main/kotlin/com/lightspark/UmaConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ data class UmaConfig(
val nodeID: String,
val username: String,
val userID: String,
val umaEncryptionCertificate: String,
val umaEncryptionPubKeyHex: String,
val umaEncryptionPrivKeyHex: String,
val umaSigningCertificate: String,
val umaSigningPubKeyHex: String,
val umaSigningPrivKeyHex: String,
val clientBaseURL: String?,
Expand Down Expand Up @@ -39,10 +41,15 @@ data class UmaConfig(
?: error("LIGHTSPARK_UMA_RECEIVER_USER not set"),
// Static UUID so that callback URLs are always the same.
userID = "4b41ae03-01b8-4974-8d26-26a35d28851b",
umaEncryptionCertificate = System.getenv("LIGHTSPARK_UMA_ENCRYPTION_CERT")
?: error("LIGHTSPARK_UMA_ENCRYPTION_CERT not set"),
umaEncryptionPubKeyHex = System.getenv("LIGHTSPARK_UMA_ENCRYPTION_PUBKEY")
?: error("LIGHTSPARK_UMA_ENCRYPTION_PUBKEY not set"),
umaEncryptionPrivKeyHex = System.getenv("LIGHTSPARK_UMA_ENCRYPTION_PRIVKEY")
?: error("LIGHTSPARK_UMA_ENCRYPTION_PRIVKEY not set"),
umaSigningCertificate =
System.getenv("LIGHTSPARK_UMA_SIGNING_CERT")
?: error("LIGHTSPARK_UMA_SIGNING_CERT not set"),
umaSigningPubKeyHex = System.getenv("LIGHTSPARK_UMA_SIGNING_PUBKEY")
?: error("LIGHTSPARK_UMA_SIGNING_PUBKEY not set"),
umaSigningPrivKeyHex = System.getenv("LIGHTSPARK_UMA_SIGNING_PRIVKEY")
Expand Down
2 changes: 1 addition & 1 deletion umaserverdemo/src/main/kotlin/com/lightspark/Vasp1.kt
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ class Vasp1(

val payReq = try {
uma.getPayRequest(
receiverEncryptionPubKey = vasp2PubKeys.encryptionPubKey,
receiverEncryptionPubKey = vasp2PubKeys.getEncryptionPublicKey(),
sendingVaspPrivateKey = config.umaSigningPrivKey,
receivingCurrencyCode = currencyCode,
isAmountInReceivingCurrency = !isAmountInMsats,
Expand Down