public class NugetFile extends ZipFile implements Signable
Constructor and Description |
---|
NugetFile(File file)
Create an NuGet from the specified file.
|
NugetFile(SeekableByteChannel channel)
Create an NuGet from the specified channel.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
computeDigest(DigestAlgorithm digestAlgorithm)
Computes the digest of the file.
|
ASN1Object |
createIndirectData(DigestAlgorithm digestAlgorithm)
Creates the SpcIndirectDataContent structure containing the digest of the file.
|
List<org.bouncycastle.asn1.cms.Attribute> |
createSignedAttributes(X509Certificate certificate)
Creates the signed attributes to include in the signature.
|
CMSTypedData |
createSignedContent(DigestAlgorithm digestAlgorithm)
Creates the ContentInfo or EncapsulatedContentInfo structure to be signed.
|
List<CMSSignedData> |
getSignatures()
Returns the Authenticode signatures on the file.
|
void |
save()
Saves the file.
|
void |
setSignature(CMSSignedData signature)
Sets the signature of the file, overwriting the previous one.
|
addEntry, close, getInputStream, getInputStream, removeEntry, renameEntry
public NugetFile(File file) throws IOException
file
- the file to openIOException
- if an I/O error occurspublic NugetFile(SeekableByteChannel channel) throws IOException
channel
- the channel to read the file fromIOException
- if an I/O error occurspublic byte[] computeDigest(DigestAlgorithm digestAlgorithm) throws IOException
Signable
computeDigest
in interface Signable
digestAlgorithm
- the digest algorithm to useIOException
- if an I/O error occurspublic ASN1Object createIndirectData(DigestAlgorithm digestAlgorithm)
Signable
createIndirectData
in interface Signable
digestAlgorithm
- the digest algorithm to usepublic List<org.bouncycastle.asn1.cms.Attribute> createSignedAttributes(X509Certificate certificate) throws CertificateEncodingException
Signable
createSignedAttributes
in interface Signable
certificate
- the signing certificateCertificateEncodingException
public CMSTypedData createSignedContent(DigestAlgorithm digestAlgorithm) throws IOException
Signable
createSignedContent
in interface Signable
digestAlgorithm
- the digest algorithm to useIOException
- if an I/O error occurspublic List<CMSSignedData> getSignatures() throws IOException
Signable
getSignatures
in interface Signable
IOException
- if an I/O error occurspublic void save() throws IOException
Signable
save
in interface Signable
IOException
- if an I/O error occurspublic void setSignature(CMSSignedData signature) throws IOException
Signable
setSignature
in interface Signable
signature
- the signature to put, or null to remove the signatureIOException
- if an I/O error occursCopyright © 2012–2025. All rights reserved.