com.jp.protection.priv.pro
Class ProtectionLauncherConfigWriter

java.lang.Object
  extended by com.jp.protection.priv.pro.ProtectionLauncherConfigWriter

public class ProtectionLauncherConfigWriter
extends java.lang.Object

This class is intended to encode and write ProtectionLauncherConfig to the file or output stream


Field Summary
protected  byte[] fEncryptKeyBytes
           
protected  java.lang.String fSecurityAlgorithm
           
protected  SecurityProvider fSecurityProvider
           
protected  boolean fSkipEncryption
           
protected  boolean fVerbose
           
 
Constructor Summary
ProtectionLauncherConfigWriter()
          Creates a new instance of the ProtectionLauncherConfigWriter
ProtectionLauncherConfigWriter(Product aProduct)
          Creates a new instance of the ProtectionLauncherConfigWriter
ProtectionLauncherConfigWriter(java.lang.String aSecurityAlgorithm, byte[] aEncryptKeyBytes)
           
 
Method Summary
protected  void error(java.lang.Throwable aThrowable)
           
 byte[] getEncryptKeyBytes()
          Returns bytes array that specifies key used to encrypt the ProtectionLauncherConfig.
 java.lang.String getSecurityAlgorithm()
          Returns security algorithm to be used to encode ProtectionLauncherConfig's
protected  SecurityProvider getSecurityProvider()
           
 boolean isSkipEncryption()
          Checks whether ProtectionLauncherConfig encryption should be skipped.
 boolean isVerbose()
          Checks whether writer runs in verbose mode.
 void setEncryptKeyBytes(byte[] aEncryptKeyBytes)
          Specifies bytes array that represents key used to encrypt the ProtectionLauncherConfig.
 void setSecurityAlgorithm(java.lang.String aSecurityAlgorithm)
          Specifies security algorithm to be used to encode ProtectionLauncherConfig's
 void setSkipEncryption(boolean aSkipEncryption)
          Specifies that ProtectionLauncherConfig encryption should be skipped.
 void setVerbose(boolean aVerbose)
          Specifies that writer should run in verbose mode.
 void write(ProtectionLauncherConfig aConfig, java.io.File aFile)
          Encodes and writes ProtectionLauncherConfig to the specified file
 void write(ProtectionLauncherConfig aConfig, java.io.File aJarFile, java.lang.String anEntryName)
          Encodes and writes ProtectionLauncherConfig as an entry to the specified JAR file
 void write(ProtectionLauncherConfig aConfig, java.io.OutputStream anOutputStream)
          Encodes and writes ProtectionLauncherConfig to the specified stream
 
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

fEncryptKeyBytes

protected byte[] fEncryptKeyBytes

fSecurityProvider

protected SecurityProvider fSecurityProvider
Constructor Detail

ProtectionLauncherConfigWriter

public ProtectionLauncherConfigWriter()
Creates a new instance of the ProtectionLauncherConfigWriter


ProtectionLauncherConfigWriter

public ProtectionLauncherConfigWriter(java.lang.String aSecurityAlgorithm,
                                      byte[] aEncryptKeyBytes)

ProtectionLauncherConfigWriter

public ProtectionLauncherConfigWriter(Product aProduct)
Creates a new instance of the ProtectionLauncherConfigWriter

Parameters:
aProduct - product to create writer for
Method Detail

getSecurityProvider

protected SecurityProvider getSecurityProvider()

getSecurityAlgorithm

public java.lang.String getSecurityAlgorithm()
Returns security algorithm to be used to encode ProtectionLauncherConfig's

Returns:
resurity algorithm

setSecurityAlgorithm

public void setSecurityAlgorithm(java.lang.String aSecurityAlgorithm)
Specifies security algorithm to be used to encode ProtectionLauncherConfig's

Parameters:
aSecurityAlgorithm - resurity algorithm

getEncryptKeyBytes

public byte[] getEncryptKeyBytes()
Returns bytes array that specifies key used to encrypt the ProtectionLauncherConfig.

Returns:
key bytes

setEncryptKeyBytes

public void setEncryptKeyBytes(byte[] aEncryptKeyBytes)
Specifies bytes array that represents key used to encrypt the ProtectionLauncherConfig.

Parameters:
aEncryptKeyBytes - key bytes

isSkipEncryption

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

Returns:
true ProtectionLauncherConfig encryption should be skipped, false otherwise.

setSkipEncryption

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

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

isVerbose

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

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

setVerbose

public void setVerbose(boolean aVerbose)
Specifies that writer should run in verbose mode. If writer 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 writer should run in verbose mode, false otherwise.

write

public void write(ProtectionLauncherConfig aConfig,
                  java.io.OutputStream anOutputStream)
           throws java.io.IOException
Encodes and writes ProtectionLauncherConfig to the specified stream

Parameters:
aConfig - ProtectionLauncherConfig to encode and write
anOutputStream - stream to write ProtectionLauncherConfig to
Throws:
java.io.IOException - in case of writing error

error

protected void error(java.lang.Throwable aThrowable)

write

public void write(ProtectionLauncherConfig aConfig,
                  java.io.File aFile)
           throws java.io.IOException
Encodes and writes ProtectionLauncherConfig to the specified file

Parameters:
aConfig - ProtectionLauncherConfig to encode and write
aFile - file to write ProtectionLauncherConfig to
Throws:
java.io.IOException - in case of writing error

write

public void write(ProtectionLauncherConfig aConfig,
                  java.io.File aJarFile,
                  java.lang.String anEntryName)
           throws java.io.IOException
Encodes and writes ProtectionLauncherConfig as an entry to the specified JAR file

Parameters:
aConfig - ProtectionLauncherConfig to encode and write
aJarFile - JAR file to write ProtectionLauncherConfig to
anEntryName - name of entry to save ProtectionLauncherConfig to
Throws:
java.io.IOException - in case of writing error