This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Other Languages and the fly likes SecretKeyFactory Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Languages » Other Languages
Bookmark "SecretKeyFactory" Watch "SecretKeyFactory" New topic


ron mccarthy

Joined: Apr 29, 2004
Posts: 17
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
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 43970
Not a "beginning Java" question. Moving thread.
Adam Nottingham

Joined: Mar 04, 2010
Posts: 6

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.
Have you checked out Aspose?
subject: SecretKeyFactory
It's not a secret anymore!