public static AttestationReport fromByteArray()

in sdk/host/src/main/java/org/apache/teaclave/javasdk/host/AttestationReport.java [75:96]


    public static AttestationReport fromByteArray(byte[] attestationReport) {
        EnclaveType enclaveType = EnclaveType.NONE;
        byte[] report = new byte[attestationReport.length - 1];
        switch (attestationReport[0]) {
            case 0:
                break;
            case 1:
                enclaveType = EnclaveType.MOCK_IN_JVM;
                break;
            case 2:
                enclaveType = EnclaveType.MOCK_IN_SVM;
                break;
            case 3:
                enclaveType = EnclaveType.TEE_SDK;
                break;
            case 4:
                enclaveType = EnclaveType.EMBEDDED_LIB_OS;
                break;
        }
        System.arraycopy(attestationReport, 1, report, 0, report.length);
        return new AttestationReport(enclaveType, report);
    }