Skip to content

Commit c7074f4

Browse files
Clearer protection (#3629)
* Be consistent with example. * Skip unneeded indentation. * Remove incorrect referene. * Try to be clearer. * Default for dates. * Rename class a suggested. * Apply suggestions from code review Co-authored-by: Henrik Tidefelt <[email protected]>
1 parent 327a469 commit c7074f4

File tree

1 file changed

+26
-23
lines changed

1 file changed

+26
-23
lines changed

chapters/annotations.tex

Lines changed: 26 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2440,14 +2440,15 @@ \subsection{Licensing}\label{licensing}
24402440
record Protection
24412441
/*literal*/ constant Access access;
24422442
/*literal*/ constant String features[:] "Required license features";
2443-
2444-
record License
2445-
/*literal*/ constant String libraryKey;
2446-
/*literal*/ constant String licenseFile = "" "Optional, default mapping if empty";
2447-
end License;
2443+
/*literal*/ constant UserLicense License;
24482444
end Protection;
2445+
2446+
record UserLicense "Internal class name, do not use"
2447+
/*literal*/ constant String libraryKey;
2448+
/*literal*/ constant String licenseFile = "" "Default mapping if empty";
2449+
end UserLicense;
24492450
\end{lstlisting}
2450-
See \cref{protection-of-classes} for a description of \lstinline!access!, and note that licensing information uses another record \lstinline!Protection! with different contents given below.
2451+
See \cref{protection-of-classes} for a description of \lstinline!access!.
24512452
The \fmtannotationindex{License} annotation has only an effect on the top of an encrypted class and is then valid for the whole class hierarchy.
24522453
(Usually the licensed class is a package.)
24532454
The \lstinline!libraryKey! is a secret string from the library vendor and is the protection mechanism so that a user cannot generate his/her own authorization file since the \lstinline!libraryKey! is unknown to him/her.
@@ -2472,26 +2473,28 @@ \subsection{Licensing}\label{licensing}
24722473

24732474
In order that the protected class can be used either a tool specific license manager, or a license file (called \lstinline!licenseFile!) must be present.
24742475
The license file is standardized.
2475-
It is a Modelica package without classes that has a \lstinline!Protection! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually:
2476+
It is a Modelica package without classes that has an \lstinline!Authorization! annotation of the following form which specifies a sequence of target records, which makes it natural to define start/end dates for different sets of targets individually:
24762477
\begin{lstlisting}[language=modelica]
2477-
record Protection
2478-
record Authorization
2479-
/*literal*/ constant String licensor = "" "Optional string to show information about the licensor";
2480-
/*literal*/ constant String libraryKey "Matching the key in the class. Must be encrypted and not visible";
2481-
/*literal*/ constant License license[:] "Definition of the license options and of the access rights";
2482-
end Authorization;
2483-
2484-
record License
2485-
/*literal*/ constant String licensee = "" "Optional string to show information about the licensee";
2486-
/*literal*/ constant String id[:] "Unique machine identifications, e.g., MAC addresses";
2487-
/*literal*/ constant String features[:] "Activated library license features";
2488-
/*literal*/ constant String startDate = "" "Optional start date in UTCformat YYYY-MM-DD";
2489-
/*literal*/ constant String expirationDate = "" "Optional expiration date in UTCformat YYYY-MM-DD";
2490-
/*literal*/ constant String operations[:] "Library usage conditions";
2491-
end License;
2492-
end Protection;
2478+
record Authorization
2479+
/*literal*/ constant String licensor = "" "Information about the licensor";
2480+
/*literal*/ constant String libraryKey "Matching the key in the class. Must be encrypted and not visible";
2481+
/*literal*/ constant License license[:] "Definition of the license options and of the access rights";
2482+
end Authorization;
24932483
\end{lstlisting}%
24942484
\index{Authorization@\robustinline{Authorization}!license file}\index{License@\robustinline{License}!license file}
2485+
using the following definition:
2486+
\begin{lstlisting}[language=modelica]
2487+
record License
2488+
/*literal*/ constant String licensee = "" "Information about the licensee";
2489+
/*literal*/ constant String id[:] "Unique machine identifications, e.g., MAC addresses";
2490+
/*literal*/ constant String features[:] "Activated library license features";
2491+
/*literal*/ constant String startDate = "" "Start date in UTCformat YYYY-MM-DD";
2492+
/*literal*/ constant String expirationDate = "" "Expiration date in UTCformat YYYY-MM-DD";
2493+
/*literal*/ constant String operations[:] "Library usage conditions";
2494+
end License;
2495+
\end{lstlisting}
2496+
2497+
If \lstinline!startDate! and \lstinline!expirationDate! are empty (the default) it is a perpetual license.
24952498

24962499
The format of the strings used for \lstinline!libraryKey! and \lstinline!id! are not specified (they are vendor specific).
24972500
The \lstinline!libraryKey! is a secret of the library developer.

0 commit comments

Comments
 (0)