<%# Opennet Firmware Copyright 2010 Rene Ejury Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 -%> <% require("luci.model.opennet.on_crt_data") require("luci.model.opennet.funcs") %>

<%:Key/Cert Status%>

<% if certstatus.on_crt_exists then %> <% end %> <% if certstatus.on_csr_exists and not certstatus.on_keycrt_ok then %> <% end %> <% else %> <% end %> <% else %> <% end %>
<% display_crt_infotable(certtype) %><% display_csr_infotable(certtype) %>
<% print(os.date("%c", certstatus.on_csr_date)) %>
   
<%:download%>

<% if certstatus.on_key_exists then %>
<% print(os.date("%c", certstatus.on_key_date)) %>
   
<%:download%>
   

<% if certstatus.on_crt_exists then %>
<% print(os.date("%c", certstatus.on_crt_date)) %>
   
<%:download%>
   
<% if certstatus.on_crt_exists and certstatus.on_key_exists and (certstatus.on_crt_modulus ~= certstatus.on_key_modulus) then if certstatus.on_csr_modulus == certstatus.on_key_modulus then %>
<%:Private Key and Certificate do not match. Please replace Certificate!%>
<% else %>
<%:Private Key and Certificate do not match. Certificate-Request also does not match Private Key, therefore sending the Certificate Request to opennet authority will not help. Please replace Certificate or Private Key or regenerate Key and Certificate Request.%>
<% end end %>
<% if certstatus.on_keycsr_ok and (not(certstatus.on_crt_exists) or not(certstatus.on_keycrt_ok)) then local uci = require "luci.model.uci" local cursor = uci.cursor() local contact_email = on_function("get_on_core_default", {"csr_contact"}) local on_id = cursor:get("on-core", "settings", "on_id") if not on_id then on_id = "" end %>
<% local type if (certtype == "ugw") then type = luci.i18n.translate("UserGateway (type user gateway)") else type = luci.i18n.translate("AccessPoint (type users)") end %>

<%:Submit certificate request%>

<%:Choose one of the following options for submitting your certificate signing request%>:

  • <%:Send your request with one click%>: <%:via Opennet%> / <%:via Internet%>
  • <%:Download the CSR file and upload it manually%>: <%:via Opennet%> / <%:via Internet%>
  • <% print(luci.i18n.translatef([[Send Certificate Request (.csr) and only this file to %s in order to get the required certificate.]], contact_email, type, on_id, contact_email)) %>
<% end %>

<%:Key Management%>

<% if certstatus.on_key_exists and certstatus.on_crt_exists and not force_show_uploadfields then %>
<% else %>
<%:upload Certificate (.crt) or Private Key (.key)%>
<% end %>