Package com.suse.coco.module.snpguest.io
Class VerificationDirectoryProvider
- java.lang.Object
-
- com.suse.coco.module.snpguest.io.VerificationDirectoryProvider
-
public class VerificationDirectoryProvider extends java.lang.ObjectCreatesVerificationDirectoryused to store the data needed by the SNPGuest tool to perform validation.- See Also:
SNPGuestWrapper
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.file.PathbaseWorkingDirstatic java.nio.file.PathDEFAULT_CERTIFICATION_PATHprivate static org.apache.logging.log4j.LoggerLOGGERprivate java.nio.file.PathsourceCertificatesDir
-
Constructor Summary
Constructors Constructor Description VerificationDirectoryProvider()Default constructor.VerificationDirectoryProvider(java.nio.file.Path baseWorkingDirIn, java.nio.file.Path sourceCertificatesDirIn)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description VerificationDirectorycreateDirectoryFor(long resultId, AttestationReport report)Creates and prepares a new verification directory.private java.nio.file.PathcreateTemporaryPath(java.lang.String prefix)
-
-
-
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 fromDEFAULT_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:- Creating a folder
- Copying the certificates into the certs/ subdirectory
- Save the report under the file "report.bin"
- Parameters:
resultId- the id of the attestation result linked to this reportreport- 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
-
-