Skip to content

Commit

Permalink
Har lagt inn maskinportenkonfig med Pkey
Browse files Browse the repository at this point in the history
  • Loading branch information
mettok committed Dec 5, 2024
1 parent 96628c2 commit 5192aa0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ plugins {
id("maven-publish")
}
group = "no.nav.helsearbeidsgiver"
version = "0.2.0.1-SNAPSHOT"
version = "0.2.0.2-SNAPSHOT"

kotlin {
compilerOptions {
Expand Down
4 changes: 3 additions & 1 deletion src/main/kotlin/MaskinportenClientConfig.kt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.nimbusds.jose.crypto.RSASSASigner
import com.nimbusds.jose.jwk.RSAKey
import com.nimbusds.jwt.JWTClaimsSet
import com.nimbusds.jwt.SignedJWT
import no.nav.helsearbeidsgiver.utils.log.logger
import java.security.KeyFactory
import java.security.PrivateKey
import java.security.spec.PKCS8EncodedKeySpec
Expand Down Expand Up @@ -82,8 +83,9 @@ class MaskinportenClientConfigPkey(

val signer = RSASSASigner(loadPrivateKey(privateKey))
val signedJWT = SignedJWT(header, claims)
logger().info("JWT claims: $claims")
signedJWT.sign(signer)

logger().info("JWT signed: ${signedJWT.serialize()}")
return signedJWT.serialize()
}
}
Expand Down

0 comments on commit 5192aa0

Please sign in to comment.