|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.android.builder.signing.SignedJarBuilder
public class SignedJarBuilder
A Jar file builder with signature support.
| Nested Class Summary | |
|---|---|
static interface |
SignedJarBuilder.IZipEntryFilter
Classes which implement this interface provides a method to check whether a file should be added to a Jar file. |
| Constructor Summary | |
|---|---|
SignedJarBuilder(java.io.OutputStream out,
java.security.PrivateKey key,
java.security.cert.X509Certificate certificate,
java.lang.String builtBy,
java.lang.String createdBy)
Creates a SignedJarBuilder with a given output stream, and signing information. |
|
| Method Summary | |
|---|---|
void |
cleanUp()
Clean up of the builder for interrupted workflow. |
void |
close()
Closes the Jar archive by creating the manifest, and signing the archive. |
void |
writeFile(java.io.File inputFile,
java.lang.String jarPath)
Writes a new File into the archive. |
void |
writeZip(java.io.InputStream input,
SignedJarBuilder.IZipEntryFilter filter)
Copies the content of a Jar/Zip archive into the receiver archive. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SignedJarBuilder(@NonNull
java.io.OutputStream out,
@Nullable
java.security.PrivateKey key,
@Nullable
java.security.cert.X509Certificate certificate,
@Nullable
java.lang.String builtBy,
@Nullable
java.lang.String createdBy)
throws java.io.IOException,
java.security.NoSuchAlgorithmException
SignedJarBuilder with a given output stream, and signing information.
If either key or certificate is null then
the archive will not be signed.
out - the OutputStream where to write the Jar archive.key - the PrivateKey used to sign the archive, or null.certificate - the X509Certificate used to sign the archive, or
null.
java.io.IOException
java.security.NoSuchAlgorithmException| Method Detail |
|---|
public void writeFile(java.io.File inputFile,
java.lang.String jarPath)
throws java.io.IOException
File into the archive.
inputFile - the File to write.jarPath - the filepath inside the archive.
java.io.IOException
public void writeZip(java.io.InputStream input,
SignedJarBuilder.IZipEntryFilter filter)
throws java.io.IOException,
SignedJarBuilder.IZipEntryFilter.ZipAbortException
SignedJarBuilder.IZipEntryFilter allows to selectively choose which files
to copy over.
input - the InputStream for the Jar/Zip to copy.filter - the filter or null
java.io.IOException
SignedJarBuilder.IZipEntryFilter.ZipAbortException - if the SignedJarBuilder.IZipEntryFilter filter indicated that the write
must be aborted.
public void close()
throws java.io.IOException,
SigningException
java.io.IOException
SigningExceptionpublic void cleanUp()
close() was called successfully.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||