| Constructor and Description |
|---|
MSIFile(File file)
Create a MSIFile from the specified file.
|
MSIFile(SeekableByteChannel channel)
Create a MSIFile from the specified channel.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the file
|
byte[] |
computeDigest(MessageDigest digest)
Computes the digest of the file.
|
ASN1Object |
createIndirectData(DigestAlgorithm digestAlgorithm)
Creates the SpcIndirectDataContent structure containing the digest of the file.
|
List<CMSSignedData> |
getSignatures()
Returns the Authenticode signatures on the file.
|
boolean |
hasExtendedSignature()
Tells if the MSI file has an extended signature (MsiDigitalSignatureEx)
containing a hash of the streams metadata (name, size, date).
|
static boolean |
isMSIFile(File file)
Tells if the specified file is a MSI file.
|
void |
save()
Saves the file.
|
void |
setSignature(CMSSignedData signature)
Sets the signature of the file, overwriting the previous one.
|
public MSIFile(File file) throws IOException
file - the file to openIOException - if an I/O error occurspublic MSIFile(SeekableByteChannel channel) throws IOException
channel - the channel to read the file fromIOException - if an I/O error occurspublic void close() throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - if an I/O error occurspublic byte[] computeDigest(MessageDigest digest) throws IOException
SignablecomputeDigest in interface Signabledigest - the message digest to updateIOException - if an I/O error occurspublic ASN1Object createIndirectData(DigestAlgorithm digestAlgorithm) throws IOException
SignablecreateIndirectData in interface SignabledigestAlgorithm - the digest algorithm to useIOException - if an I/O error occurspublic List<CMSSignedData> getSignatures() throws IOException
SignablegetSignatures in interface SignableIOException - if an I/O error occurspublic boolean hasExtendedSignature()
true if the file has a MsiDigitalSignatureEx stream, false otherwisepublic static boolean isMSIFile(File file) throws IOException
file - the file to checktrue if the file is a Microsoft installer, false otherwiseIOException - if an I/O error occurspublic void save() throws IOException
Signablesave in interface SignableIOException - if an I/O error occurspublic void setSignature(CMSSignedData signature) throws IOException
SignablesetSignature in interface Signablesignature - the signature to putIOException - if an I/O error occursCopyright © 2012–2020. All rights reserved.