home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / modules / security / freenav / secstubs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  3.0 KB  |  126 lines

  1. /*
  2.  * The contents of this file are subject to the Netscape Public License
  3.  * Version 1.0 (the "NPL"); you may not use this file except in
  4.  * compliance with the NPL.  You may obtain a copy of the NPL at
  5.  * http://www.mozilla.org/NPL/
  6.  *
  7.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  8.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  9.  * for the specific language governing rights and limitations under the
  10.  * NPL.
  11.  *
  12.  * The Initial Developer of this code under the NPL is Netscape
  13.  * Communications Corporation.  Portions created by Netscape are
  14.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  15.  * Reserved.
  16.  */
  17. #ifndef _SECSTUBS_H_
  18. #define _SECSTUBS_H_
  19.  
  20. SEC_BEGIN_PROTOS
  21.  
  22. CERTCertificate *
  23. CERT_DupCertificate(CERTCertificate *cert);
  24.  
  25. void
  26. CERT_DestroyCertificate(CERTCertificate *cert);
  27.  
  28. CERTCertificate *
  29. CERT_NewTempCertificate (CERTCertDBHandle *handle, SECItem *derCert,
  30.              char *nickname, PRBool isperm, PRBool copyDER);
  31.  
  32. CERTCertDBHandle *
  33. CERT_GetDefaultCertDB(void);
  34.  
  35. CERTCertificate *
  36. CERT_DecodeCertFromPackage(char *certbuf, int certlen);
  37.  
  38. char *
  39. CERT_HTMLCertInfo(CERTCertificate *cert, PRBool showImages, PRBool showIssuer);
  40.  
  41. PRBool
  42. CERT_CompareCertsForRedirection(CERTCertificate *c1, CERTCertificate *c2);
  43.  
  44. unsigned long
  45. SSL_SecurityCapabilities(void);
  46.  
  47. int
  48. SSL_SetSockPeerID(PRFileDesc *fd, char *peerID);
  49.  
  50. int
  51. SSL_SecurityStatus(PRFileDesc *fd, int *on, char **cipher,
  52.            int *keySize, int *secretKeySize,
  53.            char **issuer, char **subject);
  54.  
  55. CERTCertificate *
  56. SSL_PeerCertificate(PRFileDesc *fd);
  57.  
  58. PRBool
  59. SSL_IsDomestic(void);
  60.  
  61. SECStatus
  62. RNG_RNGInit(void);
  63.  
  64. SECStatus
  65. RNG_GenerateGlobalRandomBytes(void *dest, size_t len);
  66.  
  67. size_t
  68. RNG_GetNoise(void *buf, size_t maxbytes);
  69.  
  70. void
  71. RNG_SystemInfoForRNG(void);
  72.  
  73. void RNG_FileForRNG(char *filename);
  74.  
  75. SECStatus
  76. RNG_RandomUpdate(void *data, size_t bytes);
  77.  
  78. SECStatus
  79. MD5_HashBuf(unsigned char *dest, const unsigned char *src,
  80.         uint32 src_length);
  81.  
  82. MD5Context *
  83. MD5_NewContext(void);
  84.  
  85. void
  86. MD5_DestroyContext(MD5Context *cx, PRBool freeit);
  87.  
  88. void
  89. MD5_Begin(MD5Context *cx);
  90.  
  91. void
  92. MD5_Update(MD5Context *cx, const unsigned char *input, unsigned int inputLen);
  93.  
  94. void
  95. MD5_End(MD5Context *cx, unsigned char *digest,
  96.     unsigned int *digestLen, unsigned int maxDigestLen);
  97.  
  98. SECStatus
  99. SHA1_HashBuf(unsigned char *dest, const unsigned char *src, uint32 src_length);
  100.  
  101. SHA1Context *
  102. SHA1_NewContext(void);
  103.  
  104. void
  105. SHA1_DestroyContext(SHA1Context *cx, PRBool freeit);
  106.  
  107. void
  108. SHA1_Begin(SHA1Context *cx);
  109.  
  110. void
  111. SHA1_Update(SHA1Context *cx, const unsigned char *input, unsigned int inputLen);
  112.  
  113. void
  114. SHA1_End(SHA1Context *cx, unsigned char *digest,
  115.      unsigned int *digestLen, unsigned int maxDigestLen);
  116.  
  117. char *
  118. BTOA_DataToAscii(const unsigned char *data, unsigned int len);
  119.  
  120. unsigned char *
  121. ATOB_AsciiToData(const char *string, unsigned int *lenp);
  122.  
  123. SEC_END_PROTOS
  124.  
  125. #endif /* _SECSTUBS_H_ */
  126.