http://www.perlmonks.org?node_id=307850


in reply to Re: Perl & Java -- Can they keep a secret?
in thread Perl & Java -- Can they keep a secret?

This was originally my entire plan... essentially. The only problem was my inability to locate an equivilant to Digest::MD5 for Java that didn't involve adding other 'providers.' I assume I could look into Digest::MD5::Perl or one of those variants and adapt it to Java, but something about that seems an awful lot like reinventing the wheel.

Thanks for confirming my faith in my original idea -- perhaps I will try implementing MD5 myself and see what happens.



My code doesn't have bugs, it just develops random features.

Flame

  • Comment on Re: Re: Perl & Java -- Can they keep a secret?

Replies are listed 'Best First'.
Re: Re: Re: Perl & Java -- Can they keep a secret?
by hossman (Prior) on Nov 18, 2003 at 01:02 UTC
    The only problem was my inability to locate an equivilant to Digest::MD5 for Java that didn't involve adding other 'providers.'

    You don't have to register a new security provider just to use MD5 Digests. Take a look at this method in the MessageDigest class pay particular attention to the "Note: the provider doesn't have to be registered." part.

      It still requires the provider's presence... and it is my understanding that the sun provider is the only one included in the core Java dist.




      My code doesn't have bugs, it just develops random features.

      Flame

        I don't think so.

        I haven't dealt with crypto providers much, but as i understand it the whole point of the two different "getInstance" methods is that in one case you are saying "get me an instance from whichever provider is configured in my JVM for "foo". In the other case you are saying "get me an instace from this provider, right here, this one, the one i'm passing you" -- all you have to do is make sure you have a constructed Provider object.

        Even if I'm wrong, you can still modify the security providers list at run time... that's what Security.addProvider and Security.insertProviderAt are for.

Re: Re: Re: Perl & Java -- Can they keep a secret?
by sgifford (Prior) on Nov 18, 2003 at 03:24 UTC
      Ooh, THIS might be exactly what I needed. Thanks. I'll look into it and report how it goes!




      My code doesn't have bugs, it just develops random features.

      Flame