anchor.diff:  
   malformed_request_message(Any, Req, State) ->
       chef_wm_util:malformed_request_message(Any, Req, State).
  +
  +%% Return either a public key or a public key wrapped in a certificate along
  +%% with the corresponding private key.
  +generate_keypair(Name, RequestId) ->
  +    case application:get_env(chef_wm, local_key_gen) of
  +        {ok, {true, Bits}} ->
  +            KeyPair = chef_certgen:rsa_generate_keypair(Bits),
  +            #rsa_key_pair{public_key = PublicKey, private_key = PrivateKey} = KeyPair,
  +            {PublicKey, PrivateKey};
  +        _ ->
  +            chef_cert_http:gen_cert(Name, RequestId)
  +    end.
  
positive.code: -module(chef_wm_clients).
  
  -include("chef_wm.hrl").
  
  -mixin([{chef_wm_base, [content_types_accepted/2,
                          content_types_provided/2,
  
negative.code:                            resource_state = #client_state{client_data = ClientData,
                                                            client_authz_id = AuthzId}} = State) ->
      Name = ej:get({<<"name">>}, ClientData),
      {PublicKey, PrivateKey} = generate_keypair(Name, RequestId),
      ClientData1 = chef_client:add_authn_fields(ClientData, PublicKey),
      case chef_wm_base:create_from_json(Req, State, chef_client, {authz_id, AuthzId}, ClientData1) of
          {true, Req1, State1} ->
              Req2 = chef_wm_util:append_field_to_json_body(Req1, <<"private_key">>, PrivateKey),
  