Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

100 lines
2.4 KiB

  1. // CreatingKeyDlg.h : header file
  2. //
  3. // string constants for distinguishing names. Non-localized
  4. #define SZ_KEY_COUNTRY _T("C=")
  5. #define SZ_KEY_STATE _T("S=")
  6. #define SZ_KEY_LOCALITY _T("L=")
  7. #define SZ_KEY_ORGANIZATION _T("O=")
  8. #define SZ_KEY_ORGUNIT _T("OU=")
  9. #define SZ_KEY_COMNAME _T("CN=")
  10. // declared here, but implemented in ckey.cpp
  11. PUCHAR PCreateEncodedRequest( PVOID pRequest, DWORD* cbRequest, BOOL fMime );
  12. void uudecode_cert(char *bufcoded, DWORD *pcbDecoded );
  13. typedef struct ADMIN_INFO
  14. {
  15. CString* pName;
  16. CString* pEmail;
  17. CString* pPhone;
  18. CString* pCommonName;
  19. CString* pOrgUnit;
  20. CString* pOrg;
  21. CString* pLocality;
  22. CString* pState;
  23. CString* pCountry;
  24. } ADMIN_INFO, *PADMIN_INFO;
  25. /////////////////////////////////////////////////////////////////////////////
  26. // CCreatingKeyDlg dialog
  27. class CCreatingKeyDlg : public CDialog
  28. {
  29. // Construction
  30. public:
  31. CCreatingKeyDlg(CWnd* pParent = NULL); // standard constructor
  32. ~CCreatingKeyDlg(); // standard destructor
  33. BOOL FGenerateKeyPair( void );
  34. void PostGenerateKeyPair();
  35. // the info has to come from somewhere...
  36. CNKChooseCA* m_ppage_Choose_CA;
  37. CNKUserInfo* m_ppage_User_Info;
  38. CNKKeyInfo* m_ppage_Key_Info;
  39. CNKDistinguishedName* m_ppage_DN;
  40. CNKDistinguisedName2* m_ppage_DN2;
  41. BOOL m_fGenerateKeyPair;
  42. BOOL m_fResubmitKey;
  43. BOOL m_fRenewExistingKey;
  44. // the service that controls the key
  45. CService* m_pService;
  46. // the key that is being made
  47. CKey* m_pKey;
  48. // the data that is being output
  49. DWORD m_cbPrivateKey;
  50. PVOID m_pPrivateKey;
  51. DWORD m_cbCertificate;
  52. PVOID m_pCertificate;
  53. DWORD m_cbCertificateRequest;
  54. PVOID m_pCertificateRequest;
  55. // Dialog Data
  56. //{{AFX_DATA(CCreatingKeyDlg)
  57. enum { IDD = IDD_CREATING_NEW_KEY };
  58. CStatic m_cstatic_message;
  59. CButton m_btn_ok;
  60. CAnimateCtrl m_animation;
  61. CString m_sz_message;
  62. //}}AFX_DATA
  63. // Overrides
  64. // ClassWizard generated virtual function overrides
  65. //{{AFX_VIRTUAL(CCreatingKeyDlg)
  66. protected:
  67. virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
  68. //}}AFX_VIRTUAL
  69. // Implementation
  70. protected:
  71. virtual BOOL OnInitDialog();
  72. void CreateNewKey();
  73. BOOL WriteRequestToFile();
  74. BOOL SubmitRequestToAuthority();
  75. BOOL RetargetKey();
  76. void BuildAuthErrorMessage( BSTR bstrMesage, HRESULT hErr );
  77. // Generated message map functions
  78. //{{AFX_MSG(CCreatingKeyDlg)
  79. // NOTE: the ClassWizard will add member functions here
  80. //}}AFX_MSG
  81. DECLARE_MESSAGE_MAP()
  82. };