param(
  [Parameter(Mandatory=$true)][string]$Licensee,
  [Parameter(Mandatory=$true)][string]$Expires
)

$secret = "OBS-BASEBALL-OVERLAY-2026-LICENSE-SECRET-v1"
$payload = "$($Licensee.Trim().ToUpperInvariant())|$($Expires.Trim())"
$hmac = [System.Security.Cryptography.HMACSHA256]::new([Text.Encoding]::UTF8.GetBytes($secret))
$hash = $hmac.ComputeHash([Text.Encoding]::UTF8.GetBytes($payload))
$key = ([BitConverter]::ToString($hash) -replace "-", "").Substring(0, 24)

[pscustomobject]@{
  licensee = $Licensee
  expires = $Expires
  key = $key
} | ConvertTo-Json
