Kotlin SDK
JVM17 integration with the actual verifier, scope and Ktor APIs.
The Kotlin source uses plugin 2.1.0, JVM toolchain 17, group id.openagent, and version 0.1.0. Its package namespace is id.openagent.sdk.
For a local multi-project build, add the source project explicitly rather than assuming a Maven artifact exists:
include(":openagent-sdk")
project(":openagent-sdk").projectDir = file("../openagent-sdk/sdks/kotlin")dependencies {
implementation(project(":openagent-sdk"))
}Resolve a compatible Kotlin/Gradle/JVM toolchain and the declared dependencies before compiling. Public Maven availability must be checked for the version you intend to consume.
Verify with explicit policy
import id.openagent.sdk.Act
import id.openagent.sdk.Scope
fun verifyCalendar(
token: ByteArray,
publicKey: ByteArray,
issuer: String,
audience: String,
): Act.Claims {
val verifier = Act.Verifier(
trustedKeys = listOf(publicKey),
expectedIssuer = issuer,
expectedAudience = audience,
requiredScopes = listOf(Scope.parse("tools:calendar:invoke")),
)
return verifier.verify(token)
}Construction rejects invalid key/configuration input. Verification rejects malformed or unauthorized tokens. Keep exceptions on the denial path. Do not authorize using a decoded envelope before verification.
Available modules
Act.kt provides token verification, Scope.kt scope parsing, Keys.kt custody, Ktor.kt the Ktor integration, Errors.kt failures, and Cbor.kt the local decoder. The build declares Ktor3 and Bouncy Castle dependencies; this package is JVM-specific in the current source, not a Kotlin Multiplatform artifact.
Kotlin encryption-key derivation currently uses SHA-256. Read the custody limits before moving seeds from another SDK.
Source: openagent-sdk/sdks/kotlin/build.gradle.kts and src/main/kotlin/id/openagent/sdk.