That makes sense. The problem is I cannot quite see how to successfully decode 
their values from base64. I can see the first part looks like the exponent and 
the second the modulus. 

exponent: ++11Ik
modulus: 
kyC6iOY9TyHww-HX-EhLTlpnb3R6Z4Zdu0VwUWsPJMfFQNlyEzKcxck1ZyxyebtGiLVZRByKE9YKhr91OrTqRU

So if you could successfully decode them, I think you could feed the bytes into 
an RSAPublicKeySpec object instead of X509EncodedKeySpec. 

<cfset keyspec = createObject("java", 
"java.security.spec.RSAPublicKeySpec").init(modulus, exp) />
...

Then encrypt as before. While I can get a Cipher to work, the encrypted value 
comes out wrong. ie It does not match the results of TextCrypt. I am not sure 
what is different about their base64 string besides the "-" and padding.


      

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:343057
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to