<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# source: google/cloud/confidentialcomputing/v1/service.proto

namespace Google\Cloud\ConfidentialComputing\V1;

use Google\Protobuf\Internal\GPBType;
use Google\Protobuf\Internal\GPBUtil;
use Google\Protobuf\RepeatedField;

/**
 * TPM2 data containing everything necessary to validate any platform state
 * measured into the TPM.
 *
 * Generated from protobuf message <code>google.cloud.confidentialcomputing.v1.TpmAttestation</code>
 */
class TpmAttestation extends \Google\Protobuf\Internal\Message
{
    /**
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     *
     * Generated from protobuf field <code>repeated .google.cloud.confidentialcomputing.v1.TpmAttestation.Quote quotes = 1;</code>
     */
    private $quotes;
    /**
     * The binary TCG Event Log containing events measured into the TPM by the
     * platform firmware and operating system. Formatted as described in the
     * "TCG PC Client Platform Firmware Profile Specification".
     *
     * Generated from protobuf field <code>bytes tcg_event_log = 2;</code>
     */
    protected $tcg_event_log = '';
    /**
     * An Event Log containing additional events measured into the TPM that are
     * not already present in the tcg_event_log. Formatted as described in the
     * "Canonical Event Log Format" TCG Specification.
     *
     * Generated from protobuf field <code>bytes canonical_event_log = 3;</code>
     */
    protected $canonical_event_log = '';
    /**
     * DER-encoded X.509 certificate of the Attestation Key (otherwise known as
     * an AK or a TPM restricted signing key) used to generate the quotes.
     *
     * Generated from protobuf field <code>bytes ak_cert = 4;</code>
     */
    protected $ak_cert = '';
    /**
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     *
     * Generated from protobuf field <code>repeated bytes cert_chain = 5;</code>
     */
    private $cert_chain;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type \Google\Cloud\ConfidentialComputing\V1\TpmAttestation\Quote[] $quotes
     *           TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     *     @type string $tcg_event_log
     *           The binary TCG Event Log containing events measured into the TPM by the
     *           platform firmware and operating system. Formatted as described in the
     *           "TCG PC Client Platform Firmware Profile Specification".
     *     @type string $canonical_event_log
     *           An Event Log containing additional events measured into the TPM that are
     *           not already present in the tcg_event_log. Formatted as described in the
     *           "Canonical Event Log Format" TCG Specification.
     *     @type string $ak_cert
     *           DER-encoded X.509 certificate of the Attestation Key (otherwise known as
     *           an AK or a TPM restricted signing key) used to generate the quotes.
     *     @type string[] $cert_chain
     *           List of DER-encoded X.509 certificates which, together with the ak_cert,
     *           chain back to a trusted Root Certificate.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Confidentialcomputing\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     *
     * Generated from protobuf field <code>repeated .google.cloud.confidentialcomputing.v1.TpmAttestation.Quote quotes = 1;</code>
     * @return RepeatedField<\Google\Cloud\ConfidentialComputing\V1\TpmAttestation\Quote>
     */
    public function getQuotes()
    {
        return $this->quotes;
    }

    /**
     * TPM2 PCR Quotes generated by calling TPM2_Quote on each PCR bank.
     *
     * Generated from protobuf field <code>repeated .google.cloud.confidentialcomputing.v1.TpmAttestation.Quote quotes = 1;</code>
     * @param \Google\Cloud\ConfidentialComputing\V1\TpmAttestation\Quote[] $var
     * @return $this
     */
    public function setQuotes($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Google\Cloud\ConfidentialComputing\V1\TpmAttestation\Quote::class);
        $this->quotes = $arr;

        return $this;
    }

    /**
     * The binary TCG Event Log containing events measured into the TPM by the
     * platform firmware and operating system. Formatted as described in the
     * "TCG PC Client Platform Firmware Profile Specification".
     *
     * Generated from protobuf field <code>bytes tcg_event_log = 2;</code>
     * @return string
     */
    public function getTcgEventLog()
    {
        return $this->tcg_event_log;
    }

    /**
     * The binary TCG Event Log containing events measured into the TPM by the
     * platform firmware and operating system. Formatted as described in the
     * "TCG PC Client Platform Firmware Profile Specification".
     *
     * Generated from protobuf field <code>bytes tcg_event_log = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setTcgEventLog($var)
    {
        GPBUtil::checkString($var, False);
        $this->tcg_event_log = $var;

        return $this;
    }

    /**
     * An Event Log containing additional events measured into the TPM that are
     * not already present in the tcg_event_log. Formatted as described in the
     * "Canonical Event Log Format" TCG Specification.
     *
     * Generated from protobuf field <code>bytes canonical_event_log = 3;</code>
     * @return string
     */
    public function getCanonicalEventLog()
    {
        return $this->canonical_event_log;
    }

    /**
     * An Event Log containing additional events measured into the TPM that are
     * not already present in the tcg_event_log. Formatted as described in the
     * "Canonical Event Log Format" TCG Specification.
     *
     * Generated from protobuf field <code>bytes canonical_event_log = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setCanonicalEventLog($var)
    {
        GPBUtil::checkString($var, False);
        $this->canonical_event_log = $var;

        return $this;
    }

    /**
     * DER-encoded X.509 certificate of the Attestation Key (otherwise known as
     * an AK or a TPM restricted signing key) used to generate the quotes.
     *
     * Generated from protobuf field <code>bytes ak_cert = 4;</code>
     * @return string
     */
    public function getAkCert()
    {
        return $this->ak_cert;
    }

    /**
     * DER-encoded X.509 certificate of the Attestation Key (otherwise known as
     * an AK or a TPM restricted signing key) used to generate the quotes.
     *
     * Generated from protobuf field <code>bytes ak_cert = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setAkCert($var)
    {
        GPBUtil::checkString($var, False);
        $this->ak_cert = $var;

        return $this;
    }

    /**
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     *
     * Generated from protobuf field <code>repeated bytes cert_chain = 5;</code>
     * @return RepeatedField<string>
     */
    public function getCertChain()
    {
        return $this->cert_chain;
    }

    /**
     * List of DER-encoded X.509 certificates which, together with the ak_cert,
     * chain back to a trusted Root Certificate.
     *
     * Generated from protobuf field <code>repeated bytes cert_chain = 5;</code>
     * @param string[] $var
     * @return $this
     */
    public function setCertChain($var)
    {
        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::BYTES);
        $this->cert_chain = $arr;

        return $this;
    }

}

