public interface Signable
| Modifier and Type | Method and Description |
|---|---|
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.
|
static Signable |
of(File file)
Returns a signable object for the file specified.
|
static Signable |
of(File file,
Charset encoding)
Returns a signable object for the file specified.
|
void |
save()
Saves the file.
|
void |
setSignature(CMSSignedData signature)
Sets the signature of the file, overwriting the previous one.
|
byte[] computeDigest(MessageDigest digest) throws IOException
digest - the message digest to updateIOException - if an I/O error occursASN1Object createIndirectData(DigestAlgorithm digestAlgorithm) throws IOException
digestAlgorithm - the digest algorithm to useIOException - if an I/O error occursList<CMSSignedData> getSignatures() throws IOException
IOException - if an I/O error occursstatic Signable of(File file) throws IOException
file - the file that is intended to to be signedIOException - if an I/O error occursUnsupportedOperationException - if the file specified isn't supportedstatic Signable of(File file, Charset encoding) throws IOException
file - the file that is intended to to be signedencoding - the character encoding (for text files only).
If the file has a byte order mark this parameter is ignored.IOException - if an I/O error occursUnsupportedOperationException - if the file specified isn't supportedvoid save() throws IOException
IOException - if an I/O error occursvoid setSignature(CMSSignedData signature) throws IOException
signature - the signature to putIOException - if an I/O error occursCopyright © 2012–2020. All rights reserved.