• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The "Key" interface.

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 1164
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic