private static ProtoParametersSerialization serializeParameters(
      AesCtrHmacAeadParameters parameters) throws GeneralSecurityException {
    return ProtoParametersSerialization.create(
        KeyTemplate.newBuilder()
            .setTypeUrl(TYPE_URL)
            .setValue(
                com.google.crypto.tink.proto.AesCtrHmacAeadKeyFormat.newBuilder()
                    .setAesCtrKeyFormat(
                        com.google.crypto.tink.proto.AesCtrKeyFormat.newBuilder()
                            .setParams(
                                com.google.crypto.tink.proto.AesCtrParams.newBuilder()
                                    .setIvSize(parameters.getIvSizeBytes())
                                    .build())
                            .setKeySize(parameters.getAesKeySizeBytes())
                            .build())
                    .setHmacKeyFormat(
                        com.google.crypto.tink.proto.HmacKeyFormat.newBuilder()
                            .setParams(getHmacProtoParams(parameters))
                            .setKeySize(parameters.getHmacKeySizeBytes())
                            .build())
                    .build()
                    .toByteString())
            .setOutputPrefixType(toProtoOutputPrefixType(parameters.getVariant()))
            .build());
  }
Methods to serialize and parse {@link AesCtrHmacAeadKey} objects and {@link
AesCtrHmacAeadParameters} objects.
java_src/src/main/java/com/google/crypto/tink/aead/internal/AesCtrHmacAeadProtoSerialization.java