Class VerificationDirectoryProvider


  • public class VerificationDirectoryProvider
    extends java.lang.Object
    Creates VerificationDirectory used to store the data needed by the SNPGuest tool to perform validation.
    See Also:
    SNPGuestWrapper
    • Field Detail

      • DEFAULT_CERTIFICATION_PATH

        public static final java.nio.file.Path DEFAULT_CERTIFICATION_PATH
      • LOGGER

        private static final org.apache.logging.log4j.Logger LOGGER
      • baseWorkingDir

        private final java.nio.file.Path baseWorkingDir
      • sourceCertificatesDir

        private final java.nio.file.Path sourceCertificatesDir
    • Constructor Detail

      • VerificationDirectoryProvider

        public VerificationDirectoryProvider()
        Default constructor. Creates the working directory in system temporary folder and reads certificates from DEFAULT_CERTIFICATION_PATH.
      • VerificationDirectoryProvider

        VerificationDirectoryProvider​(java.nio.file.Path baseWorkingDirIn,
                                      java.nio.file.Path sourceCertificatesDirIn)
    • Method Detail

      • createDirectoryFor

        public VerificationDirectory createDirectoryFor​(long resultId,
                                                        AttestationReport report)
                                                 throws java.io.IOException
        Creates and prepares a new verification directory. The creation process involves:
        1. Creating a folder
        2. Copying the certificates into the certs/ subdirectory
        3. Save the report under the file "report.bin"
        Parameters:
        resultId - the id of the attestation result linked to this report
        report - the attestation report
        Returns:
        the created VerificationDirectory
        Throws:
        java.io.IOException - when something went wrong during the preparation of the directory.
      • createTemporaryPath

        private java.nio.file.Path createTemporaryPath​(java.lang.String prefix)
                                                throws java.io.IOException
        Throws:
        java.io.IOException