com.jp.protection.pub.pro
Class IntegrityHostProConfigReader

java.lang.Object
  extended by com.jp.protection.pub.pro.IntegrityHostProConfigReader

public class IntegrityHostProConfigReader
extends java.lang.Object

This class allows reading IntegrityHostPro.Config configuration.

Since:
3.0

Field Summary
protected  byte[] fDecryptKeyBytes
           
protected  java.lang.String fSecurityAlgorithm
           
protected  SecurityProvider fSecurityProvider
           
protected  boolean fSkipEncryption
           
protected  boolean fVerbose
           
 
Constructor Summary
IntegrityHostProConfigReader()
          Creates a new instance of reader.
 
Method Summary
protected  void error(java.lang.Throwable aThrowable)
           
 byte[] getDecryptKeyBytes()
          Returns bytes array that specifies key used to decrypt the IntegrityHostPro.Config.
 java.lang.String getSecurityAlgorithm()
          Returns security algorithm to be used to decode IntegrityHostPro.Config's
protected  SecurityProvider getSecurityProvider()
           
 boolean isSkipEncryption()
          Checks whether IntegrityHostPro.Config encryption should be skipped.
 boolean isVerbose()
          Checks whether reader runs in verbose mode.
protected  void read(IntegrityHostPro.Config aConfig, byte[] aConfigBytes)
           
 void read(IntegrityHostPro.Config aConfig, java.io.File aFile)
          Reads and decodes IntegrityHostPro.Config from the specified file
 void read(IntegrityHostPro.Config aConfig, java.io.File aJarFile, java.lang.String anEntryName)
          Reads and decodes IntegrityHostPro.Config from an entry of the specified JAR file
 void read(IntegrityHostPro.Config aConfig, java.io.InputStream anInputStream)
          Reads and decodes IntegrityHostPro.Config from the specified stream
 void read(IntegrityHostPro.Config aConfig, java.lang.String aResourceName)
          Reads and decodes IntegrityHostPro.Config from the specified resource
 void setDecryptKeyBytes(byte[] aDecryptKeyBytes)
          Specifies bytes array that represents key used to decrypt the IntegrityHostPro.Config.
 void setDecryptKeyBytes(java.lang.String aDecryptKeyBytes)
          Specifies bytes array used to restore the key required to decrypt the the IntegrityHostPro.Config.
 void setSecurityAlgorithm(java.lang.String aSecurityAlgorithm)
          Specifies security algorithm to be used to decode IntegrityHostPro.Config's
 void setSkipEncryption(boolean aSkipEncryption)
          Specifies that IntegrityHostPro.Config encryption should be skipped.
 void setVerbose(boolean aVerbose)
          Specifies that reader should run in verbose mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fVerbose

protected boolean fVerbose

fSkipEncryption

protected boolean fSkipEncryption

fSecurityAlgorithm

protected java.lang.String fSecurityAlgorithm

fDecryptKeyBytes

protected byte[] fDecryptKeyBytes

fSecurityProvider

protected SecurityProvider fSecurityProvider
Constructor Detail

IntegrityHostProConfigReader

public IntegrityHostProConfigReader()
Creates a new instance of reader.

Method Detail

getSecurityProvider

protected SecurityProvider getSecurityProvider()

getSecurityAlgorithm

public java.lang.String getSecurityAlgorithm()
Returns security algorithm to be used to decode IntegrityHostPro.Config's

Returns:
resurity algorithm

setSecurityAlgorithm

public void setSecurityAlgorithm(java.lang.String aSecurityAlgorithm)
Specifies security algorithm to be used to decode IntegrityHostPro.Config's

Parameters:
aSecurityAlgorithm - resurity algorithm

getDecryptKeyBytes

public byte[] getDecryptKeyBytes()
Returns bytes array that specifies key used to decrypt the IntegrityHostPro.Config.

Returns:
key bytes

setDecryptKeyBytes

public void setDecryptKeyBytes(byte[] aDecryptKeyBytes)
Specifies bytes array that represents key used to decrypt the IntegrityHostPro.Config.

Parameters:
aDecryptKeyBytes - key bytes

setDecryptKeyBytes

public void setDecryptKeyBytes(java.lang.String aDecryptKeyBytes)
Specifies bytes array used to restore the key required to decrypt the the IntegrityHostPro.Config.

Parameters:
aDecryptKeyBytes - decrypt key bytes as String e.g. "1, 23, 45, 23, -1"

isSkipEncryption

public boolean isSkipEncryption()
Checks whether IntegrityHostPro.Config encryption should be skipped.

Returns:
true IntegrityHostPro.Config encryption should be skipped, false otherwise.

setSkipEncryption

public void setSkipEncryption(boolean aSkipEncryption)
Specifies that IntegrityHostPro.Config encryption should be skipped. Note: skipping can be useful for debugging purposes only.

Parameters:
aSkipEncryption - true if IntegrityHostPro.Config encryption should be skipped, false otherwise.

isVerbose

public boolean isVerbose()
Checks whether reader runs in verbose mode.

Returns:
true if reader runs in verbose mode, false otherwise.

setVerbose

public void setVerbose(boolean aVerbose)
Specifies that reader should run in verbose mode. If reader run in verbose mode all thrown exceptions and stack traces will be printed out to the stderr. Otherwise there is no output generated in order to prevent the "code flow" analysis.

Parameters:
aVerbose - true if reader should run in verbose mode, false otherwise.

error

protected void error(java.lang.Throwable aThrowable)

read

public void read(IntegrityHostPro.Config aConfig,
                 java.io.InputStream anInputStream)
          throws java.io.IOException
Reads and decodes IntegrityHostPro.Config from the specified stream

Parameters:
aConfig - IntegrityHostPro.Config to read and decode
anInputStream - stream to read IntegrityHostPro.Config from
Throws:
java.io.IOException - in case of reading error

read

public void read(IntegrityHostPro.Config aConfig,
                 java.lang.String aResourceName)
          throws java.io.IOException
Reads and decodes IntegrityHostPro.Config from the specified resource

Parameters:
aConfig - IntegrityHostPro.Config to read and decode
aResourceName - resource to read IntegrityHostPro.Config from
Throws:
java.io.IOException - in case of reading error

read

protected void read(IntegrityHostPro.Config aConfig,
                    byte[] aConfigBytes)
             throws java.io.IOException
Throws:
java.io.IOException

read

public void read(IntegrityHostPro.Config aConfig,
                 java.io.File aFile)
          throws java.io.IOException
Reads and decodes IntegrityHostPro.Config from the specified file

Parameters:
aConfig - IntegrityHostPro.Config to read and decode
aFile - file to read IntegrityHostPro.Config from
Throws:
java.io.IOException - in case of reading error

read

public void read(IntegrityHostPro.Config aConfig,
                 java.io.File aJarFile,
                 java.lang.String anEntryName)
          throws java.io.IOException
Reads and decodes IntegrityHostPro.Config from an entry of the specified JAR file

Parameters:
aConfig - IntegrityHostPro.Config to read and decode
aJarFile - JAR file to read IntegrityHostPro.Config from
anEntryName - name of entry to read IntegrityHostPro.Config from
Throws:
java.io.IOException - in case of reading error