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

namespace Keyapis\Kms\V1;

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

/**
 * Пара ключей.
 * # Описание модели
 *
 * Generated from protobuf message <code>keyapis.kms.v1.KeyInfo</code>
 */
class KeyInfo extends \Google\Protobuf\Internal\Message
{
    /**
     * Идентификатор.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     */
    protected $id = '';
    /**
     * Публичный ключ.
     * # Диапазон: 0..800
     *
     * Generated from protobuf field <code>string public_key = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $public_key = '';
    /**
     * Приватный ключ в зашифрованном виде.
     * # Диапазон: 0..4000
     *
     * Generated from protobuf field <code>string encrypted_private_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $encrypted_private_key = '';
    /**
     * Дата и время создания ключа
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $created_at = null;
    /**
     * Дата и время истечения жизни ключа
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expired_at = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     */
    protected $expired_at = null;

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $id
     *           Идентификатор.
     *           # Тип: Guid
     *     @type string $public_key
     *           Публичный ключ.
     *           # Диапазон: 0..800
     *     @type string $encrypted_private_key
     *           Приватный ключ в зашифрованном виде.
     *           # Диапазон: 0..4000
     *     @type \Google\Protobuf\Timestamp $created_at
     *           Дата и время создания ключа
     *     @type \Google\Protobuf\Timestamp $expired_at
     *           Дата и время истечения жизни ключа
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Keyapis\Kms\V1\KeyapisKmsKeyV1::initOnce();
        parent::__construct($data);
    }

    /**
     * Идентификатор.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @return string
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Идентификатор.
     * # Тип: Guid
     *
     * Generated from protobuf field <code>string id = 1 [(.google.api.field_behavior) = REQUIRED];</code>
     * @param string $var
     * @return $this
     */
    public function setId($var)
    {
        GPBUtil::checkString($var, True);
        $this->id = $var;

        return $this;
    }

    /**
     * Публичный ключ.
     * # Диапазон: 0..800
     *
     * Generated from protobuf field <code>string public_key = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getPublicKey()
    {
        return $this->public_key;
    }

    /**
     * Публичный ключ.
     * # Диапазон: 0..800
     *
     * Generated from protobuf field <code>string public_key = 2 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setPublicKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->public_key = $var;

        return $this;
    }

    /**
     * Приватный ключ в зашифрованном виде.
     * # Диапазон: 0..4000
     *
     * Generated from protobuf field <code>string encrypted_private_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return string
     */
    public function getEncryptedPrivateKey()
    {
        return $this->encrypted_private_key;
    }

    /**
     * Приватный ключ в зашифрованном виде.
     * # Диапазон: 0..4000
     *
     * Generated from protobuf field <code>string encrypted_private_key = 3 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param string $var
     * @return $this
     */
    public function setEncryptedPrivateKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->encrypted_private_key = $var;

        return $this;
    }

    /**
     * Дата и время создания ключа
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    public function hasCreatedAt()
    {
        return isset($this->created_at);
    }

    public function clearCreatedAt()
    {
        unset($this->created_at);
    }

    /**
     * Дата и время создания ключа
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp created_at = 4 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setCreatedAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->created_at = $var;

        return $this;
    }

    /**
     * Дата и время истечения жизни ключа
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expired_at = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @return \Google\Protobuf\Timestamp|null
     */
    public function getExpiredAt()
    {
        return $this->expired_at;
    }

    public function hasExpiredAt()
    {
        return isset($this->expired_at);
    }

    public function clearExpiredAt()
    {
        unset($this->expired_at);
    }

    /**
     * Дата и время истечения жизни ключа
     *
     * Generated from protobuf field <code>.google.protobuf.Timestamp expired_at = 5 [(.google.api.field_behavior) = OUTPUT_ONLY];</code>
     * @param \Google\Protobuf\Timestamp $var
     * @return $this
     */
    public function setExpiredAt($var)
    {
        GPBUtil::checkMessage($var, \Google\Protobuf\Timestamp::class);
        $this->expired_at = $var;

        return $this;
    }

}

