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

namespace Google\Cloud\Kms\V1;

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

/**
 * A [Digest][google.cloud.kms.v1.Digest] holds a cryptographic message digest.
 *
 * Generated from protobuf message <code>google.cloud.kms.v1.Digest</code>
 */
class Digest extends \Google\Protobuf\Internal\Message
{
    protected $digest;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $sha256
     *           A message digest produced with the SHA-256 algorithm.
     *     @type string $sha384
     *           A message digest produced with the SHA-384 algorithm.
     *     @type string $sha512
     *           A message digest produced with the SHA-512 algorithm.
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Cloud\Kms\V1\Service::initOnce();
        parent::__construct($data);
    }

    /**
     * A message digest produced with the SHA-256 algorithm.
     *
     * Generated from protobuf field <code>bytes sha256 = 1;</code>
     * @return string
     */
    public function getSha256()
    {
        return $this->readOneof(1);
    }

    public function hasSha256()
    {
        return $this->hasOneof(1);
    }

    /**
     * A message digest produced with the SHA-256 algorithm.
     *
     * Generated from protobuf field <code>bytes sha256 = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setSha256($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(1, $var);

        return $this;
    }

    /**
     * A message digest produced with the SHA-384 algorithm.
     *
     * Generated from protobuf field <code>bytes sha384 = 2;</code>
     * @return string
     */
    public function getSha384()
    {
        return $this->readOneof(2);
    }

    public function hasSha384()
    {
        return $this->hasOneof(2);
    }

    /**
     * A message digest produced with the SHA-384 algorithm.
     *
     * Generated from protobuf field <code>bytes sha384 = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setSha384($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(2, $var);

        return $this;
    }

    /**
     * A message digest produced with the SHA-512 algorithm.
     *
     * Generated from protobuf field <code>bytes sha512 = 3;</code>
     * @return string
     */
    public function getSha512()
    {
        return $this->readOneof(3);
    }

    public function hasSha512()
    {
        return $this->hasOneof(3);
    }

    /**
     * A message digest produced with the SHA-512 algorithm.
     *
     * Generated from protobuf field <code>bytes sha512 = 3;</code>
     * @param string $var
     * @return $this
     */
    public function setSha512($var)
    {
        GPBUtil::checkString($var, False);
        $this->writeOneof(3, $var);

        return $this;
    }

    /**
     * @return string
     */
    public function getDigest()
    {
        return $this->whichOneof("digest");
    }

}

