Why 2 interfaces StringEncryptor and TextEncryptor?

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Why 2 interfaces StringEncryptor and TextEncryptor?

Jason Frank
I want to have a 2-way encryptor as a member variable in my servlet.  I started out using the BasicTextEncryptor, which implements the interface TextEncryptor, so that's the type of my member variable.  Now I want to have more control over the encryptor, so I'm switching to the StandardPBEStringEncryptor that the javadocs mention as being wrapped by the BasicTextEncryptor.  I was surprised to see that this implements an identical, but different, interface called StringEncryptor.  Thus I have to make my servlet's member variable be of a different type, instead of just swapping in a different implementation of the same interface.  There has to be a reason for this interface duplication, but I can't think of what it might be.
Loading...