Class VerificationDirectoryProvider

java.lang.Object
com.suse.coco.module.snpguest.io.VerificationDirectoryProvider

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

    • DEFAULT_CERTIFICATION_PATH

      public static final Path DEFAULT_CERTIFICATION_PATH
    • LOGGER

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

      private final Path baseWorkingDir
    • sourceCertificatesDir

      private final Path sourceCertificatesDir
  • Constructor Details

    • VerificationDirectoryProvider

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

      VerificationDirectoryProvider(Path baseWorkingDirIn, Path sourceCertificatesDirIn)
  • Method Details

    • createDirectoryFor

      public VerificationDirectory createDirectoryFor(long resultId, AttestationReport report) throws 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:
      IOException - when something went wrong during the preparation of the directory.
    • createTemporaryPath

      private Path createTemporaryPath(String prefix) throws IOException
      Throws:
      IOException