File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Security and the fly likes The Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Security
Bookmark "The "Key" interface." Watch "The "Key" interface." New topic
Forums: Java in General Security
Author

The "Key" interface.

George Nowitzki
Greenhorn

Joined: Apr 27, 2013
Posts: 1
Hello everyone,
i have to implement an encoding class, and i need a class that implements the Key interface. The problem is i don't really understand what exactly are the methods of that interface supposed to do. Can someone please explain to me what is a primary key encoding format for example? For example what would getFormat return for a One-Time-Pad encryption key? Thanks in advance!
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37958
    
  22
Welcome to the Ranch

Sorry nobody seems to know the answer yet.
What is “Key”? Is it the same as this? In one of those methods, it appears simply to return the name of the algorithm, but I don’t know about the other two. I did some googling for tutorials and found several hits. I don’t know whether they are any good, but here are a few: 1 2 3.
This question is too difficult for “beginning”, so I shall try moving it to our security forum.
Mansukhdeep Thind
Ranch Hand

Joined: Jul 27, 2010
Posts: 1157

Yes Campbell, I believe he is talking about the java.security.Key interface. I myself have never come across the usage of this Interface. Maybe one of the less used features.


~ Mansukh
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41096
    
  44
The Key class is used for for encryption, not encoding; is it the former or the latter that you want to implement? I'm asking because you use both terms.

But let's back up a bit: Why are you asking this question? Do you really need to create a class that implements Key? Or would an object suffice? If the latter, you can construct one using the SecretKeySpec class.


Ping & DNS - my free Android networking tools app
 
 
subject: The "Key" interface.
 
Similar Threads
Help to decrypt string containing RSA public key
How to get key from decrypted byte[]
can and any one this abstract and interface
Marker InterFace...
Interface and abstract class