|
|
Re: Loading an encrypted emf resource [message #1036724 is a reply to message #1036629] |
Mon, 08 April 2013 18:32 |
Roshan S. Messages: 125 Registered: July 2009 |
Senior Member |
|
|
Hi Ed,
Thanks for replying.
After looking at your response I took a look at the AESCipherImpl source, and it seems pretty straight forward in decrypting an input stream. That was the main issue I was having, because I didn't know how to decrypt it using the options Map and then load it into a file.
Quote:> I'v created EMF resources and saved them to the file system. I used
> the options to encrypt them. The caveat is that the package name is
> dynamically created when saved,
What do you mean by this? - The xmlns is different for every type, because it extends the domain model.
> so I need to open the file in order to find the package name.
Are you talking about package nsURIs? -Is xmlns the same thing? If so, then yes.
> Now, I'm trying to load the EMF as an XMIResource, but since I do not
> have the package I get an IOException because the package cannot be
> found.
Where is the package? You'll always need one to read a resource? If I know the package name then I can create it in memory and dynamically register it, but since I can't load it when it's encrypted I cannot find out the package.
> I only need to access the resource so that I can get some basic
> attributes for indexing purposes. My question is:
>
> 1. How can I decrypt the file and read it without creating an EMF
> resource (ie since I used encryption options at save, can I load a
> file or inputstream some other way)?
I suppose you can always decrypt it and use a SAX parser. -I think this is my best bet.
>
> or
>
> 2. Is there a way to get the XMIResource to not look for the package
> name when loading?
If you don't want to create a model, you can just use SAX.
|
|
|
Re: Loading an encrypted emf resource [message #1036734 is a reply to message #1036724] |
Mon, 08 April 2013 18:42 |
Ed Merks Messages: 33108 Registered: July 2009 |
Senior Member |
|
|
Roshan,
Yes, looking at the implementations is always a good idea. :-)
On 08/04/2013 8:32 PM, Roshan S. wrote:
> Hi Ed, Thanks for replying.
>
> After looking at your response I took a look at the AESCipherImpl
> source, and it seems pretty straight forward in decrypting an input
> stream. That was the main issue I was having, because I didn't know
> how to decrypt it using the options Map and then load it into a file.
>
> Quote:
>> > I'v created EMF resources and saved them to the file system. I used
>> > the options to encrypt them. The caveat is that the package name is
>> > dynamically created when saved, What do you mean by this? - The
>> xmlns is different for every type, because it extends the domain model.
>> > so I need to open the file in order to find the package name.
>> Are you talking about package nsURIs? -Is xmlns the same thing? If
>> so, then yes.
>> > Now, I'm trying to load the EMF as an XMIResource, but since I do
>> not > have the package I get an IOException because the package
>> cannot be > found.
>> Where is the package? You'll always need one to read a resource? If
>> I know the package name then I can create it in memory and
>> dynamically register it, but since I can't load it when it's
>> encrypted I cannot find out the package.
>> > I only need to access the resource so that I can get some basic >
>> attributes for indexing purposes. My question is:
>> >
>> > 1. How can I decrypt the file and read it without creating an EMF >
>> resource (ie since I used encryption options at save, can I load a >
>> file or inputstream some other way)?
>> I suppose you can always decrypt it and use a SAX parser. -I think
>> this is my best bet.
>> >
>> > or
>> >
>> > 2. Is there a way to get the XMIResource to not look for the
>> package > name when loading?
>> If you don't want to create a model, you can just use SAX.
>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Powered by
FUDForum. Page generated in 0.02180 seconds