code: public byte[] getExtensionValue(String oid) {
          if (extensions == null)
              return null;
          try {
              String extAlias = OIDMap.getName(new ObjectIdentifier(oid));
              Extension crlExt = null;
  
              if (extAlias == null) { // may be unknown
                  ObjectIdentifier findOID = new ObjectIdentifier(oid);
                  Extension ex = null;
                  ObjectIdentifier inCertOID;
                  for (Enumeration<Extension> e = extensions.getElements();
                                                   e.hasMoreElements();) {
                      ex = e.nextElement();
                      inCertOID = ex.getExtensionId();
                      if (inCertOID.equals((Object)findOID)) {
                          crlExt = ex;
                          break;
                      }
                  }
              } else
                  crlExt = extensions.get(extAlias);
              if (crlExt == null)
                  return null;
              byte[] extData = crlExt.getExtensionValue();
              if (extData == null)
                  return null;
  
              DerOutputStream out = new DerOutputStream();
              out.putOctetString(extData);
              return out.toByteArray();
          } catch (Exception e) {
              return null;
          }
      }
docs: Gets the DER encoded OCTET string for the extension value
  (<em>extnValue</em>) identified by the passed in oid String.
  The <code>oid</code> string is
  represented by a set of positive whole number separated
  by ".", that means,<br>
  &lt;positive whole number&gt;.&lt;positive whole number&gt;.&lt;positive
  whole number&gt;.&lt;...&gt;
  
  @param oid the Object Identifier value for the extension.
  @return the DER encoded octet string of the extension value.