Leaked source code of windows server 2003
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.

85 lines
3.9 KiB

  1. /*++
  2. Copyright (c) 1997 Microsoft Corporation
  3. Module Name:
  4. certupgr.hxx
  5. Abstract:
  6. Declarations for functions used to upgrade K2 server certs to Avalanche server certs
  7. Author:
  8. Alex Mallet (amallet) 02-Dec-1997
  9. Boyd Multerer (boydm) 20-Jan-1998
  10. --*/
  11. #ifndef _CERTUPGR_H_
  12. #define _CERTUPGR_H_
  13. #define CERT_DER_PREFIX 17
  14. #define CERTWIZ_REQUEST_PROP_ID (CERT_FIRST_USER_PROP_ID + 0x1001)
  15. #ifdef UNICODE
  16. #define ImportKRBackupToCAPIStore ImportKRBackupToCAPIStore_W
  17. #define CopyKRCertToCAPIStore CopyKRCertToCAPIStore_W
  18. #else
  19. #define ImportKRBackupToCAPIStore ImportKRBackupToCAPIStore_A
  20. #define CopyKRCertToCAPIStore CopyKRCertToCAPIStore_A
  21. #endif
  22. // NOTE: In both the below routines the password must always be ANSI.
  23. // NOTE: The PCCERT_CONTEXT that is returned from the below routines MUST be freed
  24. // via the CAPI call CertFreeCertificateContext(). Otherwise you will be leaking.
  25. //----------------------------------------------------------------
  26. // given a path to an old keyring style backup file, this reads in the public and private
  27. // key information and, using the passed-in password, imports it into the specified
  28. // CAPI store.
  29. PCCERT_CONTEXT ImportKRBackupToCAPIStore_A(
  30. PCHAR ptszFileName, // path of the file
  31. PCHAR pszPassword, // ANSI password
  32. PCHAR pszCAPIStore, // name of the capi store
  33. BOOL bOverWrite // if true, then overwrite existing cert if already there
  34. );
  35. PCCERT_CONTEXT ImportKRBackupToCAPIStore_W(
  36. PWCHAR ptszFileName, // path of the file
  37. PCHAR pszPassword, // ANSI password
  38. PWCHAR pszCAPIStore, // name of the capi store
  39. BOOL bOverWrite // if true, then overwrite existing cert if already there
  40. );
  41. //----------------------------------------------------------------
  42. // given a path to an old keyring style backup file, this reads in the public and private
  43. // key information and, using the passed-in password, imports it into the specified
  44. // CAPI store.
  45. // ptszFilePath: Pointer to the path of the file to be imported
  46. // pszPassword: Pointer to the password. MUST BE ANSI
  47. // ptszPassword: Pointer to the CAPI store name.
  48. PCCERT_CONTEXT CopyKRCertToCAPIStore_A(
  49. PVOID pbPrivateKey, DWORD cbPrivateKey, // private key info
  50. PVOID pbPublicKey, DWORD cbPublicKey, // public key info
  51. PVOID pbPKCS10req, DWORD cbPKCS10req, // the pkcs10 request
  52. PCHAR pszPassword, // ANSI password
  53. PCHAR pszCAPIStore, // name of the capi store
  54. BOOL bOverWrite // if true, then overwrite existing cert if already there
  55. );
  56. PCCERT_CONTEXT CopyKRCertToCAPIStore_W(
  57. PVOID pbPrivateKey, DWORD cbPrivateKey, // private key info
  58. PVOID pbPublicKey, DWORD cbPublicKey, // public key info
  59. PVOID pbPKCS10req, DWORD cbPKCS10req, // the pkcs10 request
  60. PCHAR pszPassword, // ANSI password
  61. PWCHAR pszCAPIStore, // name of the capi store
  62. BOOL bOverWrite // if true, then overwrite existing cert if already there
  63. );
  64. #endif // _CERTUPGR_HXX_