Skip to content
This repository has been archived by the owner on Apr 17, 2024. It is now read-only.

Commit

Permalink
Migrate more instances of StandardCharsets to toBytesFromPrintableAscii.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 466307621
  • Loading branch information
tholenst authored and copybara-github committed Aug 9, 2022
1 parent b9d25ca commit 270f07c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ java_library(
srcs = ["ProtoParametersSerialization.java"],
deps = [
":serialization",
":util",
"//proto:tink_java_proto",
"//src/main/java/com/google/crypto/tink/util:bytes",
"@com_google_protobuf//:protobuf_javalite",
Expand All @@ -242,6 +243,7 @@ android_library(
srcs = ["ProtoParametersSerialization.java"],
deps = [
":serialization-android",
":util-android",
"//proto:tink_java_proto_lite",
"//src/main/java/com/google/crypto/tink/util:bytes-android",
"@com_google_protobuf//:protobuf_javalite",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

package com.google.crypto.tink.internal;

import static java.nio.charset.StandardCharsets.UTF_8;
import static com.google.crypto.tink.internal.Util.toBytesFromPrintableAscii;

import com.google.crypto.tink.proto.KeyTemplate;
import com.google.crypto.tink.proto.OutputPrefixType;
Expand All @@ -37,7 +37,7 @@ public final class ProtoParametersSerialization implements Serialization {

private ProtoParametersSerialization(KeyTemplate keyTemplate) {
this.keyTemplate = keyTemplate;
this.objectIdentifier = Bytes.copyFrom(keyTemplate.getTypeUrl().getBytes(UTF_8));
this.objectIdentifier = toBytesFromPrintableAscii(keyTemplate.getTypeUrl());
}

/** Creates a new {@code ProtoParametersSerialization} object from the individual parts. */
Expand Down

0 comments on commit 270f07c

Please sign in to comment.