home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 September / Chip_2002-09_cd1.bin / zkuste / vbasic / Data / Utils / XZipComp.exe / XceedEncryption.Cab / F112988_RSASign.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-07-04  |  1.9 KB  |  64 lines

  1. #ifndef __RSASIGN_H__
  2. #define __RSASIGN_H__
  3.  
  4. /* Xceed Encryption Library - RSASign Sample Application
  5.  * Copyright (c) 2001 Xceed Software Inc.
  6.  *
  7.  * [RSASign.h]
  8.  *
  9.  * This console application shows how to sign a file or a message.
  10.  * It specifically demonstrates:
  11.  *  - The SetRandomKeyPair, ReadFile and Sign methods.
  12.  *  - The Signature, PrivateKey and SigningMethod properties.
  13.  *
  14.  * This file is part of the Xceed Encryption Library sample 
  15.  * applications. The source code in this file is only intended as 
  16.  * a supplement to Xceed Encryption Library's documentation, 
  17.  * and is provided "as is", without warranty of any kind, either 
  18.  * expressed or implied. 
  19.  */
  20.  
  21. //
  22. // The Visual C++ compiler will automatically generate wrapper classes 
  23. // around available interfaces found in this type library.
  24. //
  25.  
  26. #import "XceedCRY.dll" no_namespace named_guids
  27.  
  28. //
  29. // Constants
  30. //
  31.  
  32. //Size of the buffer used to read characters from the console.
  33. #define BUFFER_SIZE   0x4000
  34.  
  35. //
  36. // Prototypes
  37. //
  38.  
  39. void SignInputFile( IXceedSigningPtr piSign, 
  40.                     const char* pszInputFileName, 
  41.                     const char* pszSignatureFileName );
  42.  
  43. void SignConsoleInput( IXceedSigningPtr piSign, 
  44.                        const char* pszSignatureFileName );
  45.  
  46. void GenerateKeyPair( IXceedSigningPtr piSign, 
  47.                       int nKeyPairSize,
  48.                       const char* pszPrivateKeyFileName, 
  49.                       const char* pszPublicKeyFileName );
  50.  
  51. void ShowHelp();
  52.  
  53. bool ExtractParameters( int argc, char* argv[],
  54.                         IXceedSigningPtr piSign, 
  55.                         short& nKeyPairSize, 
  56.                         _bstr_t& bstrInputFileName,
  57.                         _bstr_t& bstrSignatureFileName,
  58.                         bool& bGenerateKeyPair );
  59.  
  60. bool SaveSignatureToFile( const char* pszSignatureFileName, 
  61.                           IXceedSigningPtr piSign );
  62.  
  63. #endif // __RSASIGN_H__
  64.