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.

80 lines
2.2 KiB

  1. //+-------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. //
  5. // Copyright (C) Microsoft Corporation, 1996 - 1999
  6. //
  7. // File: SIPObjJV.cpp (JAVA)
  8. //
  9. // Contents: Microsoft SIP Provider
  10. //
  11. // History: 15-Feb-1997 pberkman created
  12. //
  13. //--------------------------------------------------------------------------
  14. #include "global.hxx"
  15. #include "sipobjjv.hxx"
  16. ////////////////////////////////////////////////////////////////////////////
  17. //
  18. // construct/destruct:
  19. //
  20. SIPObjectJAVA_::SIPObjectJAVA_(DWORD id) : SIPObject_(id)
  21. {
  22. memset(&SpcLink,0x00,sizeof(SPC_LINK));
  23. SpcLink.dwLinkChoice = SPC_FILE_LINK_CHOICE;
  24. SpcLink.pwszFile = OBSOLETE_TEXT_W;
  25. }
  26. BOOL SIPObjectJAVA_::RemoveSignedDataMsg(SIP_SUBJECTINFO *pSI,DWORD dwIdx)
  27. {
  28. if (this->FileHandleFromSubject(pSI, GENERIC_READ | GENERIC_WRITE))
  29. {
  30. return(JavaRemoveCertificate(this->hFile,dwIdx));
  31. }
  32. return(FALSE);
  33. }
  34. //////////////////////////////////////////////////////////////////////////////////////
  35. //
  36. // protected:
  37. //
  38. BOOL SIPObjectJAVA_::GetMessageFromFile(SIP_SUBJECTINFO *pSI, WIN_CERTIFICATE *pWinCert,
  39. DWORD dwIndex,DWORD *pcbCert)
  40. {
  41. return(JavaGetCertificateData(this->hFile,dwIndex,pWinCert,pcbCert));
  42. }
  43. BOOL SIPObjectJAVA_::PutMessageInFile(SIP_SUBJECTINFO *pSI, WIN_CERTIFICATE *pWinCert,
  44. DWORD *pdwIndex)
  45. {
  46. if ((pWinCert->dwLength <= OFFSETOF(WIN_CERTIFICATE,bCertificate)) ||
  47. (pWinCert->wCertificateType != WIN_CERT_TYPE_PKCS_SIGNED_DATA))
  48. {
  49. SetLastError((DWORD)ERROR_INVALID_PARAMETER);
  50. return(FALSE);
  51. }
  52. if (pdwIndex)
  53. {
  54. *pdwIndex = 0; // java only has 1
  55. }
  56. return(JavaAddCertificate(this->hFile,pWinCert,pdwIndex));
  57. }
  58. BOOL SIPObjectJAVA_::GetDigestStream(DIGEST_DATA *pDigestData,
  59. DIGEST_FUNCTION pfnCallBack, DWORD dwFlags)
  60. {
  61. return(JavaGetDigestStream( this->hFile,
  62. dwFlags,
  63. pfnCallBack,
  64. pDigestData));
  65. }