• 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

SecretKeyFactory

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All!!
I am currently writing some dreaded .NET classes for a client that wants some interfacing with an existing product. So I need to mimic what the SecretKeyFactory does but in C#....*sigh*.
All I want to know is does anyone know what it (SecretKeyFactory) does exactly? Apart from the generic description I found online...

SecretKey key = SecretKeyFactory.getInstance(algorithm).generateSecretKey(keySpec); <---this is the line I need understanding, etc
 
Marshal
Posts: 79177
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Not a "beginning Java" question. Moving thread.
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
http://java.sun.com/j2se/1.4.2/docs/api/javax/crypto/SecretKeyFactory.html


getInstance(algorithm) will return object according to what algorithm you specified. You can only use certain standard named algorithms such as AES, DES, DESede, etc. There is a list of the standard names somewhere.

As far as the generateSecretKey(keySpec) goes it will actually generate and return the key from the aforementioned object from the getInstance function.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic