dev@glassfish.java.net

Re: SecureRandom

From: Bill Shannon <bill.shannon_at_sun.com>
Date: Fri, 28 Aug 2009 11:27:41 -0700

Kumar Jayanti wrote on 08/28/09 02:38:
> Bill Shannon wrote:
>> Kedar Mhaswade wrote on 8/27/09 11:28 AM:
>>
>>> Bill Shannon wrote:
>>>
>>>> Kedar Mhaswade wrote on 8/26/09 5:39 PM:
>>>>
>>>>
>>>>>> Maybe someone should just put an instance of SecureRandom in the
>>>>>> Habitat
>>>>>> so everyone can get it by injection and use it?
>>>>>>
>>>>>>
>>>>> That's doable.
>>>>>
>>>>>
>>>> So who should do it?
>>>>
>>>>
>>> I think an appropriate place for this is SecurityService that Kumar
>>> owns. I also have
>>> an IdmService that does some identity management related stuff. It's an
>>> Init Service, and I can create the global SecureRandom there. It can
>>> be the usual Contract/Service thingie. Let me know what you guys prefer.
>>>
>>
>> Since I need to use it in the LocalPassword init service, it needs to
>> be done before then. Is there a way to control order of init services?
>> Or should it be done by the GlassFish startup code that calls the init
>> services?
>>
>> Kumar, are you the right person to own this?
>>
> I will just need to think a little bit and i can send a proposal. Also
> as i said, i would not put it inside security/core module since it can
> cause circular dependency issues which we better avoid at this time. I
> would like to put it in internal-api.

Thanks.

> Should it be a static singleton or a HK2 singleton. If you have an
> opinion send me your thoughts.

An HK2 singleton seems fine, but I don't have a strong opinion.