@Service @Singleton public class ASJarSigner extends Object implements org.glassfish.hk2.api.PostConstruct
This implementation searches the available keystores for the signing alias indicated in the domain.xml config or, if not specified, the default alias, the first time it is invoked to sign a JAR file. After the first requested signing it uses the same alias and provider to sign all JARs.
The public interface to this class is the static signJar method.
| Modifier and Type | Class and Description |
|---|---|
static class |
ASJarSigner.ASJarSignerException
Wraps any underlying exception.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
USER_SPECIFIED_ALIAS_PROPERTYNAME
property name optionally set by the admin in domain.xml to select an alias for signing
|
| Constructor and Description |
|---|
ASJarSigner() |
| Modifier and Type | Method and Description |
|---|---|
void |
postConstruct() |
long |
signJar(File unsignedJar,
File signedJar,
String alias,
Attributes attrs)
Creates a signed jar from the specified unsigned jar.
|
long |
signJar(File unsignedJar,
ZipOutputStream signedJar,
String alias,
Attributes attrs,
Map<String,byte[]> additionalContent)
Creates a signed ZIP output stream from an unsigned JAR and, possibly, additional content.
|
public static final String USER_SPECIFIED_ALIAS_PROPERTYNAME
public void postConstruct()
postConstruct in interface org.glassfish.hk2.api.PostConstructpublic long signJar(File unsignedJar, File signedJar, String alias, Attributes attrs) throws Exception
unsignedJar - the unsigned JAR filesignedJar - the signed JAR to be createdattrs - additional attributes to be added to the JAR's manifest main sectionException - getting the keystores from SSLUtils failspublic long signJar(File unsignedJar, ZipOutputStream signedJar, String alias, Attributes attrs, Map<String,byte[]> additionalContent) throws Exception
unsignedJar - JAR file containing most of the content to sign and returnsignedJar - already-opened ZipOutputStream to receive the signed contentalias - the alias with which to identify the cert for signing the outputattrs - additional manifest attributes to addadditionalContent - additional JAR entries to addExceptionCopyright © 2019. All rights reserved.