Skip to content

class JsonWebKeySerializer

cangjie
public class JsonWebKeySerializer

功能:提供 JsonWebKey 的 JSON 序列化与反序列化能力。

成员概览

成员功能
func read(JsonValue, JsonWebKey)从 JSON 值读取 JWK 字段。
func read(String, JsonWebKey)从 JSON 字符串读取 JWK 字段。
func writeAsJson(JsonWebKey)将 JWK 写为 JSON 对象。
func write(JsonWebKey)将 JWK 写为 JSON 字符串。

func read(JsonValue, JsonWebKey)

cangjie
public static func read(jsonValue: JsonValue, jsonWebKey: JsonWebKey): Unit

功能:从 JSON 值读取 JWK 字段。

参数:

  • jsonValue: JsonValue - 包含 JWK 数据的 JSON 值。
  • jsonWebKey: JsonWebKey - 要写入的 JWK 对象。

返回值:

  • Unit

func read(String, JsonWebKey)

cangjie
public static func read(json: String, jsonWebKey: JsonWebKey): Unit

功能:从 JSON 字符串读取 JWK 字段。

参数:

  • json: String - 包含 JWK 数据的 JSON 字符串。
  • jsonWebKey: JsonWebKey - 要写入的 JWK 对象。

返回值:

  • Unit

func writeAsJson(JsonWebKey)

cangjie
public static func writeAsJson(jsonWebKey: JsonWebKey): JsonObject

功能:将 JWK 写为 JSON 对象。

参数:

返回值:

  • JsonObject - 序列化后的 JSON 对象。

func write(JsonWebKey)

cangjie
public static func write(jsonWebKey: JsonWebKey): String

功能:将 JWK 写为 JSON 字符串。

参数:

返回值:

  • String - 序列化后的 JSON 字符串。