anchor.diff:  -export([ init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3 ]).
   
   start_link(KeyPath, PrivateKey) ->
  -  { ok, Pid } = gen_server:start_link({global, signature}, ?MODULE, [ KeyPath, PrivateKey ], []),
  -  % register(signature, Pid),
  +  { ok, Pid } = gen_server:start_link(?MODULE, [ KeyPath, PrivateKey ], []),
  +  register(signature, Pid),
     { ok, Pid }.
   
   init([ KeyPath, PrivateKey ]) ->
  
positive.code: 
  % Private Methods
  
  verify_signature(Message, DigSig, Key) ->
    case public_key:verify(Message, sha256, DigSig, Key) of
      true -> Message;
  
negative.code:         _ ->
            { reply, invalid, S }
        end
    end;
  
  handle_call({ sign, MessageToSign }, _From, S=#keys{key_path=KeyPath, private_key={KeyName,null}}) ->
    FullPath = io_lib:format("~s/~s_private.pem", [ KeyPath, KeyName ]),
    case load_key(FullPath) of 
      { ok, Key } ->
        { reply, sign_message(MessageToSign, Key), S#keys{private_key={KeyName,Key}} };
      _ ->
        { reply, invalid, S }
    end;
  
  handle_call({ sign, MessageToSign }, _From, S=#keys{private_key={_KeyName,Key}}) ->
    { reply, sign_message(MessageToSign, Key), S }.
  
  
  handle_cast(_, State) ->
    { noreply, State }.
  