base.jdbs
Class BackupArtifactAssembler

java.lang.Object
  extended by base.jdbs.BackupArtifactAssembler

public class BackupArtifactAssembler
extends java.lang.Object

This class provided methods and utils to assembly a backup.

Author:
Guido Angelo Ingenito

Field Summary
static java.lang.String DECRYPTION_DIRECTORY_NAME
           
static java.lang.String ENCRYPTION_DIRECTORY_NAME
           
 
Constructor Summary
BackupArtifactAssembler()
           
 
Method Summary
static java.io.File buildNewBackupArtifact(java.io.File repositoryDirectory, SymmetricKey symmetricKey, KeyPair keyPair, Backup backup)
          This method builds a new signed backup artifact placing it into a temp directory.
protected static void writeBackupCRC32Checksum(java.io.File crc32Output, java.io.File compressedBackup)
          This method writes a CRC32 Checksum to a file.
protected static void writeBackupMD5Digest(java.io.File MD5DigestOutput, java.io.File compressedBackup)
          This method writes a MD5 Digest to a file.
protected static void writeBackupXmlInfoFile(Backup backup, java.io.File outputInfo)
          This method writes to a file the info associated to a backup, in xml format.
protected static void writeX509Certificate(java.security.cert.X509Certificate certificate, java.io.File certificateFile)
          This method writes to a file an X509Certificate.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ENCRYPTION_DIRECTORY_NAME

public static final java.lang.String ENCRYPTION_DIRECTORY_NAME
See Also:
Constant Field Values

DECRYPTION_DIRECTORY_NAME

public static final java.lang.String DECRYPTION_DIRECTORY_NAME
See Also:
Constant Field Values
Constructor Detail

BackupArtifactAssembler

public BackupArtifactAssembler()
Method Detail

buildNewBackupArtifact

public static java.io.File buildNewBackupArtifact(java.io.File repositoryDirectory,
                                                  SymmetricKey symmetricKey,
                                                  KeyPair keyPair,
                                                  Backup backup)
                                           throws java.io.IOException
This method builds a new signed backup artifact placing it into a temp directory. The backup building process is fully described in the JDBS analysis and it consists of some phases: Phase 1: backup files encryption (only in the case of PRIVATE content). Phase 2: backup info file creation. Phase 3: backup compression. Phase 4: backup CRC32 Checksum, MD5 Digest and X509 certificate file creation. Phase 5: backup asymmetric signature ( the signature is placed on the MD5 Digest file and a new signed file is created ).

Parameters:
symmetricKey - The symmetric key to use in the encryption process.
keyPair - The asymmetric key pair to be used during the signing phase.
backup - The input backup from which the backup artifact must be created.
Returns:
The directory where the backup has been created and that contains the Compressed and Encrypted Backup Artifact and some info files. This outputted directory reference should be moved to the local JDBS users'repository.
Throws:
java.io.IOException - If something wrong happens with the filesystem.

writeBackupXmlInfoFile

protected static void writeBackupXmlInfoFile(Backup backup,
                                             java.io.File outputInfo)
This method writes to a file the info associated to a backup, in xml format.

Parameters:
backup - The backup whose info must be stored to the output file.
outputInfo - The outputFile where the info will be stored.

writeBackupCRC32Checksum

protected static void writeBackupCRC32Checksum(java.io.File crc32Output,
                                               java.io.File compressedBackup)
This method writes a CRC32 Checksum to a file.

Parameters:
crc32Output - The CRC32 Checksum file to be written.
compressedBackup - The Compressed Backup Artifact from which the CRC32 must be computed.

writeBackupMD5Digest

protected static void writeBackupMD5Digest(java.io.File MD5DigestOutput,
                                           java.io.File compressedBackup)
This method writes a MD5 Digest to a file.

Parameters:
MD5DigestOutput - The MD5 Digest file to be written.
compressedBackup - The Compressed Backup Artifact from which the CRC32 must be computed.

writeX509Certificate

protected static void writeX509Certificate(java.security.cert.X509Certificate certificate,
                                           java.io.File certificateFile)
This method writes to a file an X509Certificate.

Parameters:
certificate - The certificate that must be saved.
certificateFile - The output file where the certificate must be stored.


Copyright © 2006 SF.net. All Rights Reserved.