public class JarSignature extends Object
| Modifier and Type | Class and Description |
|---|---|
static interface |
JarSignature.InputStreamSource |
| Modifier and Type | Field and Description |
|---|---|
static String |
BLOB_SIGNATURE |
| Modifier and Type | Method and Description |
|---|---|
static JarSignature |
create(PrivateKey privateKey,
X509Certificate[] chain)
Creates new signature for signing.
|
CodeSigner[] |
getCodeSigners() |
byte[] |
getEncoded()
Returns encoded representation of signature.
|
boolean |
isValid() |
boolean |
isValidationMode() |
static JarSignature |
load(byte[] rawSignature)
Loads jar signature from given byte array.
|
void |
signJarAsBLOB(JarSignature.InputStreamSource input,
ZipOutputStream jos) |
void |
update(byte[] v) |
InputStream |
updateWithZipEntry(String name,
InputStream is)
Performs partial validation of zip/jar entry with given name and
data stream.
|
public static final String BLOB_SIGNATURE
public static JarSignature load(byte[] rawSignature) throws sun.security.pkcs.ParsingException, CertificateException, IOException, NoSuchAlgorithmException, InvalidKeyException, SignatureException
sun.security.pkcs.ParsingExceptionCertificateExceptionIOExceptionNoSuchAlgorithmExceptionInvalidKeyExceptionSignatureExceptionpublic static JarSignature create(PrivateKey privateKey, X509Certificate[] chain) throws NoSuchAlgorithmException, InvalidKeyException
privateKey - Key to be used for signing.NoSuchAlgorithmExceptionInvalidKeyExceptionpublic boolean isValidationMode()
public byte[] getEncoded()
throws NoSuchAlgorithmException,
SignatureException,
IOException
UnsupportedOperationException - if called in validation mode.NoSuchAlgorithmExceptionSignatureExceptionIOExceptionpublic InputStream updateWithZipEntry(String name, InputStream is) throws SignatureException
SignatureExceptionpublic void update(byte[] v)
throws SignatureException
SignatureExceptionpublic boolean isValid()
public CodeSigner[] getCodeSigners()
public void signJarAsBLOB(JarSignature.InputStreamSource input, ZipOutputStream jos) throws IOException, SignatureException, NoSuchAlgorithmException
Copyright © 2025. All rights reserved.