How to implement / handle hidden values like passwords in RTC attribute customization?
![]()
Using RTC Java API, I have written extensions to send custom email notifications. The email server requires Authentication username and Password to send an email. I am able to do so, using Javax email api. The problem is that the username and password are currently stored in an attribute as plain text. The value is set by default values. This is only for testing purpose. Moving from here
1) Can we have an attribute of type Password so that we can keep the password stored in the schema?
2) Is there a way to access the email configuration of the JTS server so that we can use the central configuration?
3) Can we use passwords stored in files, use encryption algorithm to access and save it when changed.
Any ideas and suggestions will help me.
Thank you.
|
Accepted answer
One other answer
![]()
actually, here is the encrypter utility source
package com.sd.tools; import java.io.UnsupportedEncodingException; import java.security.GeneralSecurityException; import com.ibm.team.repository.common.util.ObfuscationHelper; public class EncodePassword { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub if(args.length==1) { try { String enpw = ObfuscationHelper.encryptString(args[0]); // you would use this output in any password file System.out.println(enpw); // here is how you would decrypt it for use in your application. // you could get this string from the commandline, or a file, // or a properties file (pw= string) System.out.println("pw="+ObfuscationHelper.decryptString(enpw)); } catch (UnsupportedEncodingException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (GeneralSecurityException e) { // TODO Auto-generated catch block e.printStackTrace(); } } else System.out.println("need password string"); } } |