Vishal Mahajan <Vishal.Mahajan <at> Sun.COM> writes:

> 
> Are you looking for using the same provider that is passed to the first 
> XMLCipher instance (through the getProviderInstance call) in the key 
> decryption as well? If yes, then I think we make a change and pass the 
> same provider name to the EncryptedKeyResolver.
> 
> Vishal
> 
> Samuel Misecka wrote:
> 
> >Hi,
> >
> >I need to specify provider for XML decryption. I have problem because 
XMLCipher 
> >object has method getProviderInstance(...), but in method decryptToByteArray
> >(Element element) is created and registered EncryptedKeyResolver without 
> >provider name. Then EncryptedKeyResolver.engineCanResolve method calls 
> >XMLCipher.getInstance() not XMLCipher.getProviderInstance(...) because 
provider 
> >name is not available.
> >
> >     Sam.
> >
> >
> >  
> >
> 
> 

Yes, I woud like to use the same provider inside the EncryptedKeyResolver. I 
had to change EncryptKeyResolver, I added new property for provider's name and 
I created new constructor with provider's name. Then I changed 
XMLCipher.decryptToByteArray method, I create EncryptedKeyResolver using my new 
constructor with _requestedJCEProvider instead  of the original constructor for 
registering InternalKeyResolver.

    Sam.

PS: I used assembla jce provider for access to MS keystore and I had the
problem with decrypting so I need to enforce using BC provider for encrypt and 
decrypt operations.


Reply via email to