public class CmsEncryptedAsicWriter extends Object implements AsicWriter
| Constructor and Description |
|---|
CmsEncryptedAsicWriter(AsicWriter asicWriter,
X509Certificate certificate) |
CmsEncryptedAsicWriter(AsicWriter asicWriter,
X509Certificate certificate,
org.bouncycastle.asn1.ASN1ObjectIdentifier cmsAlgorithm) |
| Modifier and Type | Method and Description |
|---|---|
AsicWriter |
add(File file)
Adds another data object to the ASiC archive.
|
AsicWriter |
add(File file,
String entryName)
Adds another data object to the ASiC container, using the supplied name as the zip entry name
|
AsicWriter |
add(File file,
String entryName,
MimeType mimeType)
Adds the contents of a file into the ASiC archive using the supplied entry name and MIME type.
|
AsicWriter |
add(InputStream inputStream,
String filename)
Adds the data provided by the stream into the ASiC archive, using the name of the supplied file as the
entry name.
|
AsicWriter |
add(InputStream inputStream,
String filename,
MimeType mimeType)
Adds the contents of an input stream into the ASiC archive, under a given entry name and explicitly
identifying the MIME type.
|
AsicWriter |
add(Path path)
Adds another data object to the ASiC archive
|
AsicWriter |
add(Path path,
String entryName)
Adds another data object to the ASiC container under the entry name provided.
|
AsicWriter |
add(Path path,
String entryName,
MimeType mimeType) |
AsicWriter |
addEncrypted(File file) |
AsicWriter |
addEncrypted(File file,
String entryName) |
AsicWriter |
addEncrypted(File file,
String entryName,
MimeType mimeType) |
AsicWriter |
addEncrypted(InputStream inputStream,
String filename) |
AsicWriter |
addEncrypted(InputStream inputStream,
String filename,
MimeType mimeType) |
AsicWriter |
addEncrypted(Path path) |
AsicWriter |
addEncrypted(Path path,
String entryName) |
AsicWriter |
addEncrypted(Path path,
String entryName,
MimeType mimeType) |
AsicWriter |
setRootEntryName(String name)
Specifies which entry (file) represents the "root" document, i.e.
|
AsicWriter |
sign(File keyStoreFile,
String keyStorePassword,
String keyPassword)
Signs and closes the ASiC archive.
|
AsicWriter |
sign(File keyStoreFile,
String keyStorePassword,
String keyAlias,
String keyPassword)
Signs and closes the ASiC archive using the private and public key stored in the supplied key store under the supplied alias name.
|
AsicWriter |
sign(SignatureHelper signatureHelper)
Allows re-use of the same SignatureHelper object when creating multiple ASiC archive and hence the need to create multiple signatures.
|
protected static final String BC
public CmsEncryptedAsicWriter(AsicWriter asicWriter, X509Certificate certificate)
public CmsEncryptedAsicWriter(AsicWriter asicWriter, X509Certificate certificate, org.bouncycastle.asn1.ASN1ObjectIdentifier cmsAlgorithm)
public AsicWriter add(File file) throws IOException
add in interface AsicWriterfile - references the file to be added as a data object. The name of the entry is
extracted from the File object.IOExceptionpublic AsicWriter add(File file, String entryName) throws IOException
add in interface AsicWriterfile - references the file to be added as a data object.entryName - the archive entry name to be used.IOExceptionpublic AsicWriter add(Path path) throws IOException
add in interface AsicWriterpath - references the file to be added.IOExceptionAsicWriter.add(File)public AsicWriter add(Path path, String entryName) throws IOException
add in interface AsicWriterpath - reference to this AsicWriter.entryName - the archive entry name to be used.IOExceptionAsicWriter.add(File, String)public AsicWriter add(InputStream inputStream, String filename) throws IOException
add in interface AsicWriterinputStream - input stream of data.filename - the name of a file, which must be available in the file system in order to determine the MIME type.IOExceptionpublic AsicWriter add(File file, String entryName, MimeType mimeType) throws IOException
add in interface AsicWriterfile - references the file to be added as a data object.entryName - the archive entry name to be used.mimeType - explicitly identifies the MIME type of the entry.IOExceptionpublic AsicWriter add(Path path, String entryName, MimeType mimeType) throws IOException
add in interface AsicWriterIOExceptionAsicWriter.add(File, String, MimeType)public AsicWriter add(InputStream inputStream, String filename, MimeType mimeType) throws IOException
add in interface AsicWriterIOExceptionAsicWriter.add(Path, String, MimeType)public AsicWriter addEncrypted(File file) throws IOException
IOExceptionpublic AsicWriter addEncrypted(File file, String entryName) throws IOException
IOExceptionpublic AsicWriter addEncrypted(Path path) throws IOException
IOExceptionpublic AsicWriter addEncrypted(Path path, String entryName) throws IOException
IOExceptionpublic AsicWriter addEncrypted(InputStream inputStream, String filename) throws IOException
IOExceptionpublic AsicWriter addEncrypted(File file, String entryName, MimeType mimeType) throws IOException
IOExceptionpublic AsicWriter addEncrypted(Path path, String entryName, MimeType mimeType) throws IOException
IOExceptionpublic AsicWriter addEncrypted(InputStream inputStream, String filename, MimeType mimeType) throws IOException
IOExceptionpublic AsicWriter setRootEntryName(String name)
AsicWritersetRootEntryName in interface AsicWritername - of entry holding the root document.public AsicWriter sign(File keyStoreFile, String keyStorePassword, String keyPassword) throws IOException
AsicWritersign in interface AsicWriterkeyStoreFile - the file holding the JKS keystore file.keyStorePassword - password for the keystorekeyPassword - password protecting the private key.IOExceptionpublic AsicWriter sign(File keyStoreFile, String keyStorePassword, String keyAlias, String keyPassword) throws IOException
AsicWritersign in interface AsicWriterkeyStoreFile - the file holding the JKS keystore file.keyStorePassword - password for the keystorekeyAlias - the alias of the keystore entry holding the private and the public key.keyPassword - password protecting the private key.IOExceptionpublic AsicWriter sign(SignatureHelper signatureHelper) throws IOException
AsicWritersign in interface AsicWritersignatureHelper - instantiated SignatureHelperIOExceptionAsicWriter.sign(File, String, String, String)Copyright © 2017 Norwegian Agency for Public Management and eGovernment (Difi). All rights reserved.