Package no.difi.asic
Interface AsicWriter
- All Known Implementing Classes:
CmsEncryptedAsicWriter
public interface AsicWriter
-
Method Summary
Modifier and TypeMethodDescriptionAdds another data object to the ASiC archive.Adds another data object to the ASiC container, using the supplied name as the zip entry nameAdds the contents of a file into the ASiC archive using the supplied entry name and MIME type.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.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.Adds another data object to the ASiC archiveAdds another data object to the ASiC container under the entry name provided.setRootEntryName(String name) Specifies which entry (file) represents the "root" document, i.e. which business document to read first.Signs and closes the ASiC archive.Signs and closes the ASiC archive using the private and public key stored in the supplied key store under the supplied alias name.sign(File keyStoreFile, String keyStorePassword, KeyStoreType keyStoreType, 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.sign(SignatureHelper signatureHelper) Allows re-use of the same SignatureHelper object when creating multiple ASiC archive and hence the need to create multiple signatures.
-
Method Details
-
add
Adds another data object to the ASiC archive.- Parameters:
file- references the file to be added as a data object. The name of the entry is extracted from the File object.- Returns:
- reference to this AsicWriter
- Throws:
IOException
-
add
Adds another data object to the ASiC container, using the supplied name as the zip entry name- Parameters:
file- references the file to be added as a data object.entryName- the archive entry name to be used.- Returns:
- reference to this AsicWriter
- Throws:
IOException
-
add
Adds another data object to the ASiC archive- Parameters:
path- references the file to be added.- Returns:
- reference to this AsicWriter
- Throws:
IOException- See Also:
-
add
Adds another data object to the ASiC container under the entry name provided.- Parameters:
path- reference to this AsicWriter.entryName- the archive entry name to be used.- Returns:
- reference to this AsicWriter
- Throws:
IOException- See Also:
-
add
Adds the data provided by the stream into the ASiC archive, using the name of the supplied file as the entry name.- Parameters:
inputStream- 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.- Returns:
- reference to this AsicWriter
- Throws:
IOException
-
add
Adds the contents of a file into the ASiC archive using the supplied entry name and MIME type.- Parameters:
file- 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.- Returns:
- reference to this AsicWriter
- Throws:
IOException
-
add
- Throws:
IOException- See Also:
-
add
Adds the contents of an input stream into the ASiC archive, under a given entry name and explicitly identifying the MIME type.- Throws:
IOException- See Also:
-
setRootEntryName
Specifies which entry (file) represents the "root" document, i.e. which business document to read first.- Parameters:
name- of entry holding the root document.- Returns:
- reference to this AsicWriter
-
sign
Signs and closes the ASiC archive. The private and public key is obtained from the supplied key store.- Parameters:
keyStoreFile- the file holding the JKS keystore file.keyStorePassword- password for the keystorekeyPassword- password protecting the private key.- Returns:
- reference to this AsicWriter
- Throws:
IOException
-
sign
AsicWriter sign(File keyStoreFile, String keyStorePassword, String keyAlias, String keyPassword) throws IOException Signs and closes the ASiC archive using the private and public key stored in the supplied key store under the supplied alias name.- Parameters:
keyStoreFile- 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.- Returns:
- reference to this AsicWriter
- Throws:
IOException
-
sign
AsicWriter sign(File keyStoreFile, String keyStorePassword, KeyStoreType keyStoreType, String keyAlias, String keyPassword) throws IOException Signs and closes the ASiC archive using the private and public key stored in the supplied key store under the supplied alias name.- Parameters:
keyStoreFile- the file holding the keystore file.keyStorePassword- password for the keystorekeyStoreType- Type of keyStorekeyAlias- the alias of the keystore entry holding the private and the public key.keyPassword- password protecting the private key.- Returns:
- reference to this AsicWriter
- Throws:
IOException
-
sign
Allows re-use of the same SignatureHelper object when creating multiple ASiC archive and hence the need to create multiple signatures.- Parameters:
signatureHelper- instantiated SignatureHelper- Returns:
- reference to this AsicWriter
- Throws:
IOException- See Also:
-