|
ADK CVS | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objecttryllian.are.security.DNAComposer
The DNAComposer class can be used to programmatically create and update DNA files.
Creating a new DNA file requires the following properties to be set:
Updating a new DNA file requires the following properties to be set:
Using an illegal value when setting one of these properties will always result in an (unchecked) NullPointerException or IllegalArgumentException.
If something goes wrong in the process of creating the DNA file, a (checked) DNAComposerException is thrown, usually wrapping an exception with a more specific cause.
Once a DNAComposer has been created, the object can be used to create more than one file; properties will be remembered between calls, making it possible to use the same keystore for multiple DNA files without having to set it each time.
For more information on creating and updating DNA files, please refer to the ARE specification.
| Field Summary | |
static int |
COMPRESS
If this flag is set in the option mask, the DNA file will be compressed. |
static int |
NOVERIFY
If this flag is set, the resulting DNA-file is not verified. |
static int |
OVERWRITE
If this flag is set in the option mask and creating the DNA file would overwrite an existing file, the overwrite will take place. |
static int |
VERBOSE
Deprecated. logging/verbosity/debugging is now controlled through Log4J |
| Constructor Summary | |
DNAComposer()
Creates a new DNAComposer object. |
|
| Method Summary | |
java.io.File |
createDNAFile(java.io.File out,
java.io.File jarPath)
Creates the DNA file. |
java.io.File |
createDNAFile(java.io.File out,
java.io.File[] jarfiles)
Creates the DNA file. |
java.io.File |
createDNAFile(java.io.File out,
java.net.URL[] jarFiles)
Creates the DNA file. |
void |
setAlias(java.lang.String alias)
Sets the alias that will be used to retrieve the private key from the keystore. |
void |
setDescriptor(java.io.File descriptor)
Sets the Descriptor file. |
void |
setDescriptor(java.net.URL descriptor)
Sets the Descriptor file. |
void |
setKeyStore(java.io.File keyStore)
Sets the keystore that contains the private key. |
void |
setKeyStore(java.net.URL keyStore)
Sets the keystore that contains the private key. |
void |
setOptions(int options)
Sets the options with which the DNA file will be created. |
void |
setPassword(char[] password)
Sets the password that is used to unlock the keystore to retrieve the alias. |
java.io.File |
updateDNAFile(java.io.File out,
java.io.File original,
java.io.File[] newJarFiles)
Updates the DNA file. |
java.io.File |
updateDNAFile(java.io.File out,
java.net.URL original,
java.net.URL[] newJarFiles)
Updates the DNA file. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int COMPRESS
public static final int OVERWRITE
public static final int VERBOSE
public static final int NOVERIFY
| Constructor Detail |
public DNAComposer()
| Method Detail |
public void setDescriptor(java.net.URL descriptor)
throws DNAComposerException,
java.lang.NullPointerException
descriptor - A URL that points to the file that
contains the agent description, should not be null.
java.lang.NullPointerException - if the descriptor passed was null after all
DNAComposerException - if the descriptor URL is invalid
public void setDescriptor(java.io.File descriptor)
throws DNAComposerException,
java.lang.NullPointerException
descriptor - A file object that points to the file that
contains the agent description, cannot be null
DNAComposerException - if the descriptor name cannot be
converted to a valid URL
java.lang.NullPointerException - if the descriptor passed is null
public void setKeyStore(java.net.URL keyStore)
throws java.lang.NullPointerException
keyStore - A URL object that points to the keystore,
cannot be null.
java.lang.NullPointerException - if the keystore passed is null
public void setKeyStore(java.io.File keyStore)
throws java.lang.NullPointerException
keyStore - A File that points to the keystore, cannot be null.
java.lang.NullPointerException - if the keystore passed is null
public void setAlias(java.lang.String alias)
throws java.lang.NullPointerException
alias - the alias of the private key entry in the
keystore, cannot be null.
java.lang.NullPointerException - if the alias passed is null
public void setPassword(char[] password)
throws java.lang.NullPointerException
password - the password that unlocks the private key
java.lang.NullPointerException - if the password passed is nullpublic void setOptions(int options)
options - An integer that contains the options or-ed together.
The value 0 resets all options to their default value "off".
public java.io.File createDNAFile(java.io.File out,
java.io.File jarPath)
throws DNAComposerException
out - The name for the new DNA file, cannot be null.jarPath - The directory where the DNAComposer will look for the jarfiles
that will be stored in the DNA file; can be null if there are
no 'file's specified in the agent descriptor.
DNAComposerException - on any failure.
The DNAComposerExceptoin will usually wrap a more specific
exception, that can be approached using the
DNAComposerException.getCause() method.
This wrapped exception might be one of the following:
public java.io.File createDNAFile(java.io.File out,
java.io.File[] jarfiles)
throws DNAComposerException
out - The name for the new DNA file, cannot be null.jarfiles - The list of all jarfiles that are stored in the
DNA file. This list must match the names specified in the agent
descriptor. Can be null (if there are no file objects), but
cannot contain null objects.
DNAComposerException - on failure.
The DNAComposerExceptoin will usually wrap a more specific
exception, that can be approached using the
DNAComposerException.getCause() method.
This wrapped exception might be one of the following:
public java.io.File updateDNAFile(java.io.File out,
java.io.File original,
java.io.File[] newJarFiles)
throws DNAComposerException
out - The name of the new DNA file, cannot be null.original - The name of the DNA file that will be updated,
cannot be null.newJarFiles - An array of File objects pointing to the new
jarfiles for the updated DNA file. If there are no new files (for
example, only the certificate used for signing has been changed),
this array can be null. The array cannot contain null objects.
DNAComposerException - on failure
The DNAComposerExceptoin will usually wrap a more specific
exception, that can be approached using the
DNAComposerException.getCause() method.
This wrapped exception might be one of the following:
public java.io.File createDNAFile(java.io.File out,
java.net.URL[] jarFiles)
throws DNAComposerException
out - The name for the new DNA file, cannot be null.jarFiles - The list of all jarfiles that are stored in the
DNA file. This list must match the names specified in the agent
descriptor. Can be null (if there are no file objects), but
cannot contain null objects.
DNAComposerException - on failure
The DNAComposerExceptoin will usually wrap a more specific
exception, that can be approached using the
DNAComposerException.getCause() method.
This wrapped exception might be one of the following:
public java.io.File updateDNAFile(java.io.File out,
java.net.URL original,
java.net.URL[] newJarFiles)
throws DNAComposerException
out - The name of the new DNA file, cannot be null.original - The name of the DNA file that will be updated,
cannot be null.newJarFiles - An array of URLs pointing to the new jarfiles
for the updated DNA file. If there are no new files (for
example, only the certificate used for signing has been changed),
this array can be null. The array cannot contain null objects.
DNAComposerException - on failure
The DNAComposerExceptoin will usually wrap a more specific
exception, that can be approached using the
DNAComposerException.getCause() method.
This wrapped exception might be one of the following:
|
Copyright 2005, Tryllian Solutions B.V. | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||