About your first question
Passive complex sentence; or
Complex passive sentence?
In order to find this out you need to be familiar a topic named "order of modifiers". To the degree that an English learner should be aware of this is well taught here. Note that adjectives are not the same as modifiers linguistically, but they're usually taught to learners in a way that seem identical.
Our head noun is "sentence", right? "Passive" is a location (where "sentence" is) while "complex" is an opinion (what you think of the "sentence"). Therefore, "complex passive sentence" is the right noun phrase you get.
It's interesting how you didn't ask about "this". People usually don't find it wrong to place determiners at the beginning of the noun phrase - and they're right! So your noun phrase, in its complete form, is "this complex passive sentence".
About your second question
- First line and second line of my book
- First and second line of my book
- First and second lines of my book
Option 1 is grammatically correct; but you do admit that it's a little bit clumsy. One that knows how to write a better sentence will never repeat "line".
Option 2 is grammatically incorrect, but 3 is correct. I'm partially familiar with Arabic, Turkish, Persian and English (not bragging, I said partially :D). In all of these languages, if your subjects are "linked" with and, you have a plural noun phrase which therefore, results in a plural noun you seek; e.g.:
The following problems illustrate detailed graphing of functions of one variable using the first and second derivatives. UCDavis
Finally, its "this complex passive sentence" 's turn. (Actually, it's sentences, but who cares :D)
By users here it must be understood the ones associated to the packages (or applets) that act as a subject of policies.
Clarifying the picture of "users" in the readers' mind, the author wants to have a "set" definition of "users" for the word's future use. So users are "the ones" (more context needed, it's vague now; what are the ones? Maybe pieces of data, or applets, just like Tim mentions) that are joined to the packages. But not all packages! Packages that policies apply to.
In the Java Card System, every action is always performed by an identified user interpreted here as the currently selected applet or the package that is the subject's owner.
The Java Card System is so secure that all the actions in it are performed by an identified user. The "user" is our own user which we defined before. The user does these actions as the applet or the package. That applet or package is the owner of this subject.
In order for this Q not to look like a proofreading one (though I'm sure your goal is only understanding what's written there) I "disintegrated" the sentences down to fathomable ones. If you still have any problems, comment me.