Oracle Adaptive Access Manager .NET SDK

Integrating Native .NET Applications 3-3

3.3.2 Encrypting Property Values

A property value specified in a properties file can be encrypted using the command-line utility BharosaUtils.exe included in the Oracle Adaptive Access Manager .NET SDK. An encryption key arbitrarily selected by the user is required to encrypt and decrypt values. This key is available to Oracle Adaptive Access Manager .NET API through the property bharosa.cipher.client.key, which must be set in one of the application properties files. BharosaUtil.exe prompts the user to enter the encryption key and a value, and the encrypted value is output to the console. The following run of the utility illustrates how to encrypt a string: C:\ BharosaUtil.exe -enc Enter key min 14 characters len: your key Enter key again: your key Enter text to be encrypted: string to encryp Enter text to be encrypted again: string to encryp vCCKC19d14a39hQSKSirXSiWfgbaVG5SKIg==

3.3.3 Using User-Defined Enumerations to Define Elements

Visual Studio 2005 allows you to use enumerations defined in the .NET Framework. A user-defined enumerations are a collection of items; each item is assigned an integer and may contain several attributes. A user-defined enumeration is specified in a properties file, and its name, the names of its items, and the name of the item attributes must conform to the following rules: ■ The name of the enumeration has the suffix .enum ■ The name of an item has a prefix equals to the name of the enumeration ■ The name of an attribute of an item has a prefix equals to the name of the item Here is an example of a user-defined enumeration: Example of a user-defined enumeration auth.status.enum=Enumeration to describe authentication status first item and its attributes auth.status.enum.success=0 auth.status.enum.success.name=Success auth.status.enum.success.description=Success auth.status.enum.success.success=true second item and its attributes CurrentDirectory c:WindowsSystem32 ApplicationDirectorybharosa_properties c:InetpubwwwrootMyAppbharosa_properties CallingAssemblyDirectorybharosa_properties c:WindowsSystem32bharosa_properties CurrentAssemblyDirectorybharosa_properties c:InetpubwwwrootMyAppbinbharosa_properties CurrentAssemblyDirectory..bharosa_ properties c:InetpubwwwrootMyAppbharosa_properties CurrentDirectorybharosa_properties c:WindowsSystem32bharosa_properties Table 3–1 Cont. .NET Property Files Directory Example