// ------------------------------- //
// -------- Start of File -------- //
// ------------------------------- //
// ----------------------------------------------------------- // 
// C++ Source Code File Name: testprog.cpp
// Compiler Used: MSVC40, DJGPP 2.7.2.1, GCC 2.7.2.1, HP CPP 10.24
// Author: Doug Gaer 
// File Creation Date: 01/25/2000
// Date Last Modified: 06/21/2000
// Copyright (c) 2000 Douglas M. Gaer
// ----------------------------------------------------------- // 
// ------------- Program Description and Details ------------- // 
// ----------------------------------------------------------- // 
/*
The VBS C++ classes are copyright (c) 2000, by Douglas M. Gaer.
All those who put this code or its derivatives in a commercial
product MUST mention this copyright in their documentation for
users of the products in which this code or its derivative
classes are used. Otherwise, you have the freedom to redistribute
verbatim copies of this source code, adapt it to your specific
needs, or improve the code and release your improvements to the
public provided that the modified files carry prominent notices
stating that you changed the files and the date of any change.

THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
THE ENTIRE RISK OF THE QUALITY AND PERFORMANCE OF THIS SOFTWARE
IS WITH YOU. SHOULD ANY ELEMENT OF THIS SOFTWARE PROVE DEFECTIVE,
YOU WILL ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR, OR
CORRECTION.

This is a test program for the base 64 encode and decode
routines.
*/
// ----------------------------------------------------------- // 
#include <iostream.h>
#include "vbs_b64.h"

void InputString(const char *mesg, vbString &s)
{
  cout << mesg;
  char sbuf[255];
  for(int i = 0; i < 255; i++) sbuf[i] = 0;
  cin >> sbuf;
  s = sbuf;
}

int main()
{
  cout << endl;
  vbString wwwauth, ubuf, pbuf, user, passwd;
  cout << "Base 64 encoding username and password" << endl;
  InputString("Username: ", ubuf);
  InputString("Password: ", pbuf);
  cout << endl;
  
  vbsBasicAuthenticationEncode(ubuf.c_str(), pbuf.c_str(), "Basic", wwwauth);
  cout << wwwauth << endl;
  cout << "Decoding base 64 authentication line" << endl;
  vbsBasicAuthenticationDecode(wwwauth, user, passwd);
  cout << "Username: " << user << endl;
  cout << "Password: " << passwd << endl;
  cout << endl;
  return 0;
}
// ----------------------------------------------------------- //
// ------------------------------- //
// --------- End of File --------- //
// ------------------------------- //