<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>
  File: README
  
    &mdash; Documentation by YARD 0.8.2.1
  
</title>

  <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" charset="utf-8" />

  <link rel="stylesheet" href="css/common.css" type="text/css" media="screen" charset="utf-8" />

<script type="text/javascript" charset="utf-8">
  hasFrames = window.top.frames.main ? true : false;
  relpath = '';
  framesUrl = "frames.html#!" + escape(window.location.href);
</script>


  <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>

  <script type="text/javascript" charset="utf-8" src="js/app.js"></script>


  </head>
  <body>
    <div id="header">
      <div id="menu">
  
    <a href="_index.html">Index</a> &raquo; 
    <span class="title">File: README</span>
  

  <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
</div>

      <div id="search">
  
    <a class="full_list_link" id="class_list_link"
        href="class_list.html">
      Class List
    </a>
  
    <a class="full_list_link" id="method_list_link"
        href="method_list.html">
      Method List
    </a>
  
    <a class="full_list_link" id="file_list_link"
        href="file_list.html">
      File List
    </a>
  
</div>
      <div class="clear"></div>
    </div>

    <iframe id="search_frame"></iframe>

    <div id="content"><div id='filecontents'><p>This project is related to <a href="http://github.com/reaperhulk/r509">r509</a> and <a href="http://github.com/reaperhulk/ocsp-responder">ocsp-responder</a>, allowing certificate validity and revocation information to be read and written to a Redis backend.</p>

<p>When a certificate is issued, we want this sent to Redis:</p>

<pre class="code ruby"><code>HMSET &quot;cert:&lt;serial&gt;&quot; status 0
</code></pre>

<p>When revoked:</p>

<pre class="code ruby"><code>HMSET &quot;cert:&lt;serial&gt;&quot; status 1 revocation_time &lt;timestamp&gt; revocation_reason 0
</code></pre>

<p>To get the status of a certificate:</p>

<pre class="code ruby"><code><span class='const'>HGETALL</span> <span class='tstring'><span class='tstring_beg'>&quot;</span><span class='tstring_content'>cert:&lt;serial&gt;</span><span class='tstring_end'>&quot;</span></span>
</code></pre>

<p>The &quot;status&quot; field can be one of:</p>

<pre class="code ruby"><code><span class='const'>R509</span><span class='op'>::</span><span class='const'>Validity</span><span class='op'>::</span><span class='const'>VALID</span>
<span class='const'>R509</span><span class='op'>::</span><span class='const'>Validity</span><span class='op'>::</span><span class='const'>REVOKED</span>
</code></pre>

<p>The &quot;revocation_reason&quot; field can be one of:</p>

<pre class="code ruby"><code><span class='const'>I</span> <span class='id identifier rubyid_don'>don</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>t know, we should probably find out
</span></span></code></pre>

<p>Use this in a project like ocsp-responder by passing it into R509::Ocsp::Signer&#39;s constructor:</p>

<pre class="code ruby"><code><span class='const'>R509</span><span class='op'>::</span><span class='const'>Ocsp</span><span class='op'>::</span><span class='const'>Signer</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span>
    <span class='symbol'>:validity_checker</span> <span class='op'>=&gt;</span> <span class='const'>R509</span><span class='op'>::</span><span class='const'>Validity</span><span class='op'>::</span><span class='const'>Redis</span><span class='op'>::</span><span class='const'>Checker</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='lparen'>(</span><span class='const'>Redis</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span><span class='rparen'>)</span>
<span class='rparen'>)</span>
</code></pre>
</div></div>

    <div id="footer">
  Generated on Mon Oct 15 10:51:03 2012 by
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
  0.8.2.1 (ruby-1.9.3).
</div>

  </body>
</html>