<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- BEGIN COPYRIGHT BLOCK
     Copyright (C) 2006 Red Hat, Inc.
     All rights reserved.
     END COPYRIGHT BLOCK -->
<!DOCTYPE web-app 
   PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "file:///usr/share/pki/setup/web-app_2_3.dtd">
<web-app>

    <display-name>Token Key Service</display-name>

   <servlet>
      <servlet-name>  tksstart  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.base.CMSStartServlet  </servlet-class>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksstart    </param-value> </init-param>
      <load-on-startup>  1  </load-on-startup>
   </servlet>
                                                                                
   <servlet>
      <servlet-name>  tksug  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.admin.UsrGrpAdminServlet  </servlet-class>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksug       </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
   </servlet>

   <servlet>
      <servlet-name>  tkslog  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.admin.LogAdminServlet  </servlet-class>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tkslog      </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
   </servlet>
                                                                                
   <servlet>
      <servlet-name>  tksauths  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.admin.AuthAdminServlet  </servlet-class>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksauths    </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
   </servlet>
                         
<!--                                                       
   <servlet>
      <servlet-name>  tksjobsScheduler  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.admin.JobsAdminServlet  </servlet-class>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksjobsScheduler </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
   </servlet>
-->

   <servlet>
      <servlet-name>  tksacl  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.admin.ACLAdminServlet  </servlet-class>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksacl      </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
   </servlet>
                                                                                
   <servlet>
      <servlet-name>  tksserver  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.admin.CMSAdminServlet  </servlet-class>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksserver   </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
   </servlet>

   <servlet>       
          <servlet-name>  tksRegisterUser  </servlet-name>       
          <servlet-class> com.netscape.cms.servlet.csadmin.RegisterUser  </servlet-class>              
             <init-param><param-name>  GetClientCert  </param-name>                          <param-value> false       </param-value> </init-param>
             <init-param><param-name>  authority   </param-name>
                         <param-value> tks          </param-value> </init-param>             <init-param><param-name>  ID          </param-name>
                         <param-value> tksRegisterUser </param-value> </init-param>
             <init-param><param-name>  GroupName     </param-name>
                          <param-value> Token Key Service Manager Agents </param-value> </init-param>
             <init-param><param-name>  AuthMgr     </param-name>                          <param-value> TokenAuth </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
             <init-param><param-name>  resourceID  </param-name>
                         <param-value> certServer.tks.registerUser </param-value> </init-param>
   </servlet>

   <servlet>       <servlet-name>  tksImportTransportCert  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.csadmin.ImportTransportCert  </servlet-class>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> false       </param-value> </init-param>
             <init-param><param-name>  authority   </param-name>
                         <param-value> tks          </param-value> </init-param>             <init-param><param-name>  ID          </param-name>
                         <param-value> tksImportTransportCert </param-value> </init-param>              <init-param><param-name>  AuthMgr     </param-name>
                         <param-value> TokenAuth </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
             <init-param><param-name>  resourceID  </param-name>
                         <param-value> certServer.tks.importTransportCert </param-value> </init-param>
   </servlet>


   <servlet>
      <servlet-name>  tksEncryptData  </servlet-name>
      <servlet-class> org.dogtagpki.server.tks.servlet.TokenServlet  </servlet-class>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> true        </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksEncryptData </param-value> </init-param>
             <init-param><param-name>  template    </param-name>
                         <param-value> index.template </param-value> </init-param>
             <init-param><param-name>  resourceID  </param-name>
                         <param-value> certServer.tks.encrypteddata </param-value> </init-param>
             <init-param><param-name>  AuthMgr     </param-name>
                         <param-value> certUserDBAuthMgr </param-value> </init-param>
   </servlet>
                                                                                
   <servlet>
      <servlet-name>  tksCreateKeySetData  </servlet-name>
      <servlet-class> org.dogtagpki.server.tks.servlet.TokenServlet  </servlet-class>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> true        </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksCreateKeySetData </param-value> </init-param>
             <init-param><param-name>  template    </param-name>
                         <param-value> index.template </param-value> </init-param>
             <init-param><param-name>  resourceID  </param-name>
                         <param-value> certServer.tks.keysetdata </param-value> </init-param>
             <init-param><param-name>  AuthMgr     </param-name>
                         <param-value> certUserDBAuthMgr </param-value> </init-param>
   </servlet>

   <servlet>
      <servlet-name>  tksSessionKey  </servlet-name>
      <servlet-class> org.dogtagpki.server.tks.servlet.TokenServlet  </servlet-class>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> true        </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksSessionKey </param-value> </init-param>
             <init-param><param-name>  template    </param-name>
                         <param-value> index.template </param-value> </init-param>
             <init-param><param-name>  resourceID  </param-name>
                         <param-value> certServer.tks.sessionkey </param-value> </init-param>
             <init-param><param-name>  AuthMgr     </param-name>
                         <param-value> certUserDBAuthMgr </param-value> </init-param>
   </servlet>

   <servlet>
      <servlet-name>  tksRandomData  </servlet-name>
      <servlet-class> org.dogtagpki.server.tks.servlet.TokenServlet  </servlet-class>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> true        </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksRandomData </param-value> </init-param>
             <init-param><param-name>  template    </param-name>
                         <param-value> index.template </param-value> </init-param>
             <init-param><param-name>  resourceID  </param-name>
                         <param-value> certServer.tks.randomdata </param-value> </init-param>
             <init-param><param-name>  AuthMgr     </param-name>
                         <param-value> certUserDBAuthMgr </param-value> </init-param>
   </servlet>


   <servlet>
      <servlet-name>  tksports  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.base.PortsServlet  </servlet-class>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksports    </param-value> </init-param>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> false        </param-value> </init-param>
             <init-param><param-name>  interface  </param-name>
                         <param-value> ee      </param-value> </init-param>
   </servlet>

   <servlet>
      <servlet-name>  services </servlet-name>
      <servlet-class> com.netscape.cms.servlet.csadmin.MainPageServlet </servlet-class>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> false       </param-value> </init-param>
             <init-param><param-name>  authorityId  </param-name>
                         <param-value> tks          </param-value> </init-param>
             <init-param><param-name>  ID          </param-name>
                         <param-value> services </param-value> </init-param>
             <init-param><param-name>  templatePath  </param-name>
                         <param-value> /services.template </param-value> </init-param>
   </servlet>

   <servlet>
      <servlet-name>  tksDownloadPKCS12  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.csadmin.DownloadPKCS12  </servlet-class>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> false       </param-value> </init-param>
             <init-param><param-name>  authority   </param-name>
                         <param-value> tks          </param-value> </init-param>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksDownloadPKCS12 </param-value> </init-param>
             <init-param><param-name>  interface   </param-name>
                         <param-value> ee          </param-value> </init-param>
             <init-param><param-name>  AuthMgr     </param-name>
                         <param-value> TokenAuth </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
             <init-param><param-name>  resourceID  </param-name>
                         <param-value> certServer.clone.configuration </param-value> </init-param>
   </servlet>

   <servlet>
      <servlet-name>  tksGetConfigEntries  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.csadmin.GetConfigEntries </servlet-class>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> false       </param-value> </init-param>
             <init-param><param-name>  authority   </param-name>
                         <param-value> tks          </param-value> </init-param>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksGetConfigEntries </param-value> </init-param>
             <init-param><param-name>  AuthzMgr    </param-name>
                         <param-value> BasicAclAuthz </param-value> </init-param>
             <init-param><param-name>  AuthMgr     </param-name>
                         <param-value> TokenAuth </param-value> </init-param>
             <init-param><param-name>  resourceID  </param-name>
                         <param-value> certServer.clone.configuration.GetConfigEntries </param-value> </init-param>
   </servlet>

   <servlet>
      <servlet-name>  tksGetStatus  </servlet-name>
      <servlet-class> com.netscape.cms.servlet.csadmin.GetStatus  </servlet-class>
             <init-param><param-name>  GetClientCert  </param-name>
                         <param-value> false       </param-value> </init-param>
             <init-param><param-name>  authority   </param-name>
                         <param-value> tks          </param-value> </init-param>
             <init-param><param-name>  ID          </param-name>
                         <param-value> tksGetStatus </param-value> </init-param>
   </servlet>

   <listener>
      <listener-class> org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap </listener-class>
   </listener>

   <context-param>
      <param-name>resteasy.servlet.mapping.prefix</param-name>
      <param-value>/rest</param-value>
   </context-param>

   <context-param>
      <param-name>resteasy.resource.method-interceptors</param-name>
      <param-value>
         org.jboss.resteasy.core.ResourceMethodSecurityInterceptor
      </param-value>
   </context-param>

   <servlet>
      <servlet-name>Resteasy</servlet-name>
      <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class>
      <init-param>
         <param-name>javax.ws.rs.Application</param-name>
         <param-value>org.dogtagpki.server.tks.rest.TKSApplication</param-value>
      </init-param>
   </servlet>

   <servlet-mapping>
      <servlet-name>Resteasy</servlet-name>
      <url-pattern>/rest/*</url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  tksstart  </servlet-name>
      <url-pattern>   /start  </url-pattern>
   </servlet-mapping>
                                                                                
   <servlet-mapping>
      <servlet-name>  tksug  </servlet-name>
      <url-pattern>   /ug  </url-pattern>
   </servlet-mapping>
                                                                                
   <servlet-mapping>
      <servlet-name>  tkslog  </servlet-name>
      <url-pattern>   /log  </url-pattern>
   </servlet-mapping>
                                                                                
   <servlet-mapping>
      <servlet-name>  tksauths  </servlet-name>
      <url-pattern>   /auths  </url-pattern>
   </servlet-mapping>
                         
<!--                                                       
   <servlet-mapping>
      <servlet-name>  tksjobsScheduler  </servlet-name>
      <url-pattern>   /jobsScheduler  </url-pattern>
   </servlet-mapping>
-->
                                                                                
   <servlet-mapping>
      <servlet-name>  tksacl  </servlet-name>
      <url-pattern>   /acl  </url-pattern>
   </servlet-mapping>
                                                                                
   <servlet-mapping>
      <servlet-name>  tksserver  </servlet-name>
      <url-pattern>   /server  </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  tksEncryptData  </servlet-name>
      <url-pattern>   /agent/tks/encryptData  </url-pattern>
   </servlet-mapping>
                                                                                
   <servlet-mapping>
      <servlet-name>  tksCreateKeySetData  </servlet-name>
      <url-pattern>   /agent/tks/createKeySetData  </url-pattern>
   </servlet-mapping>
                                                                                
   <servlet-mapping>
      <servlet-name>  tksSessionKey  </servlet-name>
      <url-pattern>   /agent/tks/computeSessionKey  </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  tksRandomData  </servlet-name>
      <url-pattern>   /agent/tks/computeRandomData  </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  tksGetConfigEntries  </servlet-name>
      <url-pattern>   /admin/tks/getConfigEntries  </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  tksports  </servlet-name>
      <url-pattern>   /ee/tks/ports  </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  tksRegisterUser </servlet-name>
      <url-pattern>   /admin/tks/registerUser  </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  tksImportTransportCert </servlet-name>
      <url-pattern>   /admin/tks/importTransportCert  </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  services </servlet-name>
      <url-pattern>   /services  </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  tksDownloadPKCS12 </servlet-name>
      <url-pattern>   /admin/console/config/savepkcs12 </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
      <servlet-name>  tksGetStatus  </servlet-name>
      <url-pattern>   /admin/tks/getStatus  </url-pattern>
   </servlet-mapping>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Account Services</web-resource-name>
            <url-pattern>/rest/account/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Admin Services</web-resource-name>
            <url-pattern>/rest/admin/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Audit</web-resource-name>
            <url-pattern>/rest/audit/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

    <security-constraint>
        <web-resource-collection>
            <web-resource-name>Self Tests</web-resource-name>
            <url-pattern>/rest/selftests/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <role-name>*</role-name>
        </auth-constraint>
        <user-data-constraint>
            <transport-guarantee>CONFIDENTIAL</transport-guarantee>
        </user-data-constraint>
    </security-constraint>

    <login-config>
        <realm-name>Token Key Service</realm-name>
    </login-config>

    <security-role>
        <role-name>*</role-name>
    </security-role>

</web-app>
