Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Is there a method named base64Encode?

Status
Not open for further replies.

volcano

Programmer
Aug 29, 2000
136
HK
Hello, my java program needs to make GET request to the website and get the contents of them. However the server hosting the java program resides behind the firewall; therefore I need to set up some proxy setting like System.getProperties().put("proxyHost", "MYPROXY"), etc.. As far as I know, the username and password of the authentication have to be base64-encoded. I would like to ask if there is any method doing the similar task? Or do you have any reference for passing the proxy's authentication? Thanks a lot!
 
The book "Java Security Handbook" (Sams) contains a class "Conversion" that will do this encoding. The examples from this book can be downloaded from com.samspublishing.com --> search for "Java Security Handbook" --> click on the book --> click on "downloads"
You need the class "Conversion" of chapter5 in package com.jaworski.security.handbook
Also of interest to you could be the classes "Base64EncodeConsoleApp" and "Base64DecodeConsoleApp" in the same chapter and same package. These last 2 classes take 2 parameters : an infile and an outfile.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top