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.ParsingException
CertificateException
IOException
NoSuchAlgorithmException
InvalidKeyException
SignatureException
public static JarSignature create(PrivateKey privateKey, X509Certificate[] chain) throws NoSuchAlgorithmException, InvalidKeyException
privateKey
- Key to be used for signing.NoSuchAlgorithmException
InvalidKeyException
public boolean isValidationMode()
public byte[] getEncoded() throws NoSuchAlgorithmException, SignatureException, IOException
UnsupportedOperationException
- if called in validation mode.NoSuchAlgorithmException
SignatureException
IOException
public InputStream updateWithZipEntry(String name, InputStream is) throws SignatureException
SignatureException
public void update(byte[] v) throws SignatureException
SignatureException
public boolean isValid()
public CodeSigner[] getCodeSigners()
public void signJarAsBLOB(JarSignature.InputStreamSource input, ZipOutputStream jos) throws IOException, SignatureException, NoSuchAlgorithmException
Copyright © 2020. All rights reserved.