Skip to content
Snippets Groups Projects
Commit 9021c316 authored by Tink Team's avatar Tink Team Committed by Charles Lee
Browse files

Use EnumLite.name() explicitly instead of relying on the behavior of proto lite enum toString.

PiperOrigin-RevId: 243644333
GitOrigin-RevId: a5b1c9ab283666f0c0b51bdf4d192efb9100a8dc
parent ce024a6c
No related branches found
No related tags found
No related merge requests found
......@@ -105,16 +105,16 @@ public final class JsonKeysetWriter implements KeysetWriter {
private JSONObject toJson(Key key) throws JSONException {
return new JSONObject()
.put("keyData", toJson(key.getKeyData()))
.put("status", key.getStatus().toString())
.put("status", key.getStatus().name())
.put("keyId", key.getKeyId())
.put("outputPrefixType", key.getOutputPrefixType().toString());
.put("outputPrefixType", key.getOutputPrefixType().name());
}
private JSONObject toJson(KeyData keyData) throws JSONException {
return new JSONObject()
.put("typeUrl", keyData.getTypeUrl())
.put("value", Base64.encode(keyData.getValue().toByteArray()))
.put("keyMaterialType", keyData.getKeyMaterialType().toString());
.put("keyMaterialType", keyData.getKeyMaterialType().name());
}
private JSONObject toJson(EncryptedKeyset keyset) throws JSONException {
......@@ -137,8 +137,8 @@ public final class JsonKeysetWriter implements KeysetWriter {
private JSONObject toJson(KeyInfo keyInfo) throws JSONException {
return new JSONObject()
.put("typeUrl", keyInfo.getTypeUrl())
.put("status", keyInfo.getStatus().toString())
.put("status", keyInfo.getStatus().name())
.put("keyId", keyInfo.getKeyId())
.put("outputPrefixType", keyInfo.getOutputPrefixType().toString());
.put("outputPrefixType", keyInfo.getOutputPrefixType().name());
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment