advisor.h
上传用户:lyxiangda
上传日期:2007-01-12
资源大小:3042k
文件大小:6k
源码类别:

CA认证

开发平台:

WINDOWS

  1. /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
  2. /*
  3.  * The contents of this file are subject to the Mozilla Public
  4.  * License Version 1.1 (the "License"); you may not use this file
  5.  * except in compliance with the License. You may obtain a copy of
  6.  * the License at http://www.mozilla.org/MPL/
  7.  * 
  8.  * Software distributed under the License is distributed on an "AS
  9.  * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  10.  * implied. See the License for the specific language governing
  11.  * rights and limitations under the License.
  12.  * 
  13.  * The Original Code is the Netscape security libraries.
  14.  * 
  15.  * The Initial Developer of the Original Code is Netscape
  16.  * Communications Corporation.  Portions created by Netscape are 
  17.  * Copyright (C) 1994-2000 Netscape Communications Corporation.  All
  18.  * Rights Reserved.
  19.  * 
  20.  * Contributor(s):
  21.  * 
  22.  * Alternatively, the contents of this file may be used under the
  23.  * terms of the GNU General Public License Version 2 or later (the
  24.  * "GPL"), in which case the provisions of the GPL are applicable 
  25.  * instead of those above.  If you wish to allow use of your 
  26.  * version of this file only under the terms of the GPL and not to
  27.  * allow others to use your version of this file under the MPL,
  28.  * indicate your decision by deleting the provisions above and
  29.  * replace them with the notice and other provisions required by
  30.  * the GPL.  If you do not delete the provisions above, a recipient
  31.  * may use your version of this file under either the MPL or the
  32.  * GPL.
  33.  */
  34. #ifndef __ADVISOR_H__
  35. #define __ADVISOR_H__
  36. /*
  37.   Security advisor object. We create this in order to determine what to show
  38.   in the generic "Security Info" pane, and to convey the right URL back to
  39.   the client for loading.
  40.   Created by mwelch 1999 February
  41.  */
  42. #include "resource.h"
  43. #include "ctrlconn.h"
  44. #include "certres.h"
  45. #include "p7cinfo.h"
  46. #include "slist.h"
  47. #include "sslskst.h"
  48. typedef struct InfoSecAdvisor
  49. {
  50.     PRInt32 infoContext;
  51.     PRInt32 resID;
  52.     char *hostname;
  53. char *senderAddr;
  54. PRUint32 encryptedP7CInfo;
  55. PRUint32 signedP7CInfo;
  56. PRInt32 decodeError;
  57. PRInt32 verifyError;
  58. PRInt32 encryptthis;
  59. PRInt32 signthis;
  60. PRInt32 numRecipients;
  61. char **recipients;
  62. } InfoSecAdvisor;
  63. typedef struct SSMSecurityAdvisorContext
  64. {
  65.     SSMResource super;
  66.     /* Reference to Cartman object which we use to display 
  67.        "Security Info" pane */
  68.     SSMResource *m_infoSource;
  69.     /* Width and height of the security advisor window, 
  70.        loaded from resource file */
  71.     PRUint32 m_width, m_height;
  72.     /* Cached URL which we send back to client upon request */
  73.     char *m_url;
  74.     SSMSortedList *m_certhash;
  75.     PRIntn m_certsIncluded;
  76.     char *m_nickname;
  77.     PRInt32 infoContext;
  78.     PRInt32 resID;
  79.     char *hostname;
  80. char *senderAddr;
  81. PRUint32 encryptedP7CInfo;
  82. PRUint32 signedP7CInfo;
  83. PRInt32 decodeError;
  84. PRInt32 verifyError;
  85. PRInt32 encryptthis;
  86. PRInt32 signthis;
  87. PRInt32 numRecipients;
  88. char **recipients;
  89.     char *selectedItemPage;
  90. PRInt32 encrypted_b;
  91. PRInt32 signed_b;
  92. SSMP7ContentInfo * encryptedP7CInfoRes;
  93. SSMP7ContentInfo * signedP7CInfoRes;
  94.     SSMSSLSocketStatus * socketStatus;
  95. #if 0
  96.     /* data for Java principals */
  97.     char* m_principalsData;
  98. #endif
  99. } SSMSecurityAdvisorContext;
  100. SSMStatus SSMSecurityAdvisorContext_Create(SSMControlConnection *ctrl,
  101.                                           InfoSecAdvisor *info, 
  102.                                           SSMResource **res);
  103. SSMStatus SSMSecurityAdvisorContext_Destroy(SSMResource *res, PRBool doFree);
  104.                                      
  105. void SSMSecurityAdvisorContext_Invariant(SSMSecurityAdvisorContext *ct);
  106. SSMStatus SSMSecurityAdvisorContext_GetAttrIDs(SSMResource *res,
  107.                                               SSMAttributeID **ids,
  108.                                               PRIntn *count);
  109. SSMStatus SSMSecurityAdvisorContext_GetAttr(SSMResource *res,
  110.                                            SSMAttributeID attrID,
  111.                                            SSMResourceAttrType attrType,
  112.                                            SSMAttributeValue *value);
  113. SSMStatus SSMSecurityAdvisorContext_SetAttr(SSMResource *res,
  114.                                   SSMAttributeID attrID,
  115.                                   SSMAttributeValue *value);
  116. SSMStatus SSMSecurityAdvisorContext_FormSubmitHandler(SSMResource *res,
  117.                                                       HTTPRequest *req);
  118. SSMStatus SSMSecurityAdvisorContext_Print(SSMResource *res,
  119.                                          char *fmt, PRIntn numParam,
  120.                                          char **value, char **resultStr);
  121. SSMStatus SSMSecurityAdvisorContext_DoPKCS12Response(SSMSecurityAdvisorContext *cx,
  122.                                                      HTTPRequest *req,
  123.                                             const char  *responseKey);
  124. SSMStatus SSMSecurityAdvisorContext_DoPKCS12Restore(SSMSecurityAdvisorContext *res,
  125. HTTPRequest               *req);
  126. SSMStatus SSMSecurityAdvisorContext_DoPKCS12Backup(SSMSecurityAdvisorContext *cx,
  127.                                                HTTPRequest               *req);
  128. SSMStatus SSMSecurityAdvisorContext_Process_cert_mine_form(SSMSecurityAdvisorContext *res,
  129.                                                  HTTPRequest *req);
  130. SSMStatus SSMSecurityAdvisorContext_sa_selected_item(SSMTextGenContext* cx);
  131. SSMStatus SSM_FreeTarget(SSMTextGenContext *cx);
  132. SSMStatus 
  133. SSMSecurityAdvisorContext_GetPrefListKeywordHandler(SSMTextGenContext* cx);
  134. SSMStatus SSM_SetDBPasswordHandler(HTTPRequest * req);
  135. #if 0
  136. SSMStatus SSM_JavaPrincipalsKeywordHandler(SSMTextGenContext* cx);
  137. void SSM_HandleGetJavaPrincipalsReply(SSMControlConnection* ctrl,
  138.                                       SECItem* message);
  139. #endif
  140. SSMStatus SSM_RemovePrivilegesHandler(HTTPRequest* req);
  141. SSMStatus SSM_OCSPResponderList(SSMTextGenContext* cx);
  142. char* SSM_GetOCSPURL(CERTCertificate *cert, PrefSet *prefs);
  143. PRBool SSM_IsOCSPEnabled(SSMControlConnection *connection);
  144. SSMStatus SSM_DisplayCRLButton(SSMTextGenContext *cx);
  145. SSMStatus SSM_ListCRLs(SSMTextGenContext *cx);
  146. SSMStatus SSM_LayoutSMIMETab(SSMTextGenContext *cx);
  147. SSMStatus SSM_LayoutJavaJSTab(SSMTextGenContext *cx);
  148. SSMStatus SSM_LayoutOthersTab(SSMTextGenContext *cx);
  149. #endif