<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: WAProto.proto

namespace PhpWA\Protocol\Proto\SessionStructure\Chain;

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

/**
 * Generated from protobuf message <code>proto.SessionStructure.Chain.MessageKey</code>
 */
class MessageKey extends \Google\Protobuf\Internal\Message
{
    /**
     * Generated from protobuf field <code>optional uint32 index = 1;</code>
     */
    protected $index = null;
    /**
     * Generated from protobuf field <code>optional bytes cipherKey = 2;</code>
     */
    protected $cipherKey = null;
    /**
     * Generated from protobuf field <code>optional bytes macKey = 3;</code>
     */
    protected $macKey = null;
    /**
     * Generated from protobuf field <code>optional bytes iv = 4;</code>
     */
    protected $iv = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type int $index
     *     @type string $cipherKey
     *     @type string $macKey
     *     @type string $iv
     * }
     */
    public function __construct($data = NULL) {
        \PhpWA\Protocol\Proto\Metadata\WAProto::initOnce();
        parent::__construct($data);
    }

    /**
     * Generated from protobuf field <code>optional uint32 index = 1;</code>
     * @return int
     */
    public function getIndex()
    {
        return isset($this->index) ? $this->index : 0;
    }

    public function hasIndex()
    {
        return isset($this->index);
    }

    public function clearIndex()
    {
        unset($this->index);
    }

    /**
     * Generated from protobuf field <code>optional uint32 index = 1;</code>
     * @param int $var
     * @return $this
     */
    public function setIndex($var)
    {
        GPBUtil::checkUint32($var);
        $this->index = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bytes cipherKey = 2;</code>
     * @return string
     */
    public function getCipherKey()
    {
        return isset($this->cipherKey) ? $this->cipherKey : '';
    }

    public function hasCipherKey()
    {
        return isset($this->cipherKey);
    }

    public function clearCipherKey()
    {
        unset($this->cipherKey);
    }

    /**
     * Generated from protobuf field <code>optional bytes cipherKey = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setCipherKey($var)
    {
        GPBUtil::checkString($var, False);
        $this->cipherKey = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bytes macKey = 3;</code>
     * @return string
     */
    public function getMacKey()
    {
        return isset($this->macKey) ? $this->macKey : '';
    }

    public function hasMacKey()
    {
        return isset($this->macKey);
    }

    public function clearMacKey()
    {
        unset($this->macKey);
    }

    /**
     * Generated from protobuf field <code>optional bytes macKey = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setMacKey($var)
    {
        GPBUtil::checkString($var, False);
        $this->macKey = $var;

        return $this;
    }

    /**
     * Generated from protobuf field <code>optional bytes iv = 4;</code>
     * @return string
     */
    public function getIv()
    {
        return isset($this->iv) ? $this->iv : '';
    }

    public function hasIv()
    {
        return isset($this->iv);
    }

    public function clearIv()
    {
        unset($this->iv);
    }

    /**
     * Generated from protobuf field <code>optional bytes iv = 4;</code>
     * @param string $var
     * @return $this
     */
    public function setIv($var)
    {
        GPBUtil::checkString($var, False);
        $this->iv = $var;

        return $this;
    }

}

