mirror of https://github.com/usbharu/Hideout.git
fix: jwkの形式を修正
This commit is contained in:
parent
aebf0862e0
commit
638915230b
|
@ -17,7 +17,7 @@ object JsonWebKeyUtil {
|
||||||
fun publicKeyToJwk(publicKey: RSAPublicKey): String {
|
fun publicKeyToJwk(publicKey: RSAPublicKey): String {
|
||||||
val e = encodeBase64UInt(publicKey.publicExponent)
|
val e = encodeBase64UInt(publicKey.publicExponent)
|
||||||
val n = encodeBase64UInt(publicKey.modulus)
|
val n = encodeBase64UInt(publicKey.modulus)
|
||||||
return """{"e":"$e","n":"$n","use":"sig","kty":"RSA"}"""
|
return """{"keys":[{"e":"$e","n":"$n","use":"sig","kty":"RSA"}]}"""
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun encodeBase64UInt(bigInteger: BigInteger, minLength: Int = -1): String {
|
private fun encodeBase64UInt(bigInteger: BigInteger, minLength: Int = -1): String {
|
||||||
|
|
Loading…
Reference in New Issue