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

namespace Google\Cloud\AppEngine\V1;

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

/**
 * An SSL certificate obtained from a certificate authority.
 *
 * Generated from protobuf message <code>google.appengine.v1.CertificateRawData</code>
 */
class CertificateRawData extends \Google\Protobuf\Internal\Message
{
    /**
     * PEM encoded x.509 public key certificate. This field is set once on
     * certificate creation. Must include the header and footer. Example:
     * <pre>
     * -----BEGIN CERTIFICATE-----
     * <certificate_value>
     * -----END CERTIFICATE-----
     * </pre>
     *
     * Generated from protobuf field <code>string public_certificate = 1;</code>
     */
    private $public_certificate = '';
    /**
     * Unencrypted PEM encoded RSA private key. This field is set once on
     * certificate creation and then encrypted. The key size must be 2048
     * bits or fewer. Must include the header and footer. Example:
     * <pre>
     * -----BEGIN RSA PRIVATE KEY-----
     * <unencrypted_key_value>
     * -----END RSA PRIVATE KEY-----
     * </pre>
     * &#64;InputOnly
     *
     * Generated from protobuf field <code>string private_key = 2;</code>
     */
    private $private_key = '';

    /**
     * Constructor.
     *
     * @param array $data {
     *     Optional. Data for populating the Message object.
     *
     *     @type string $public_certificate
     *           PEM encoded x.509 public key certificate. This field is set once on
     *           certificate creation. Must include the header and footer. Example:
     *           <pre>
     *           -----BEGIN CERTIFICATE-----
     *           <certificate_value>
     *           -----END CERTIFICATE-----
     *           </pre>
     *     @type string $private_key
     *           Unencrypted PEM encoded RSA private key. This field is set once on
     *           certificate creation and then encrypted. The key size must be 2048
     *           bits or fewer. Must include the header and footer. Example:
     *           <pre>
     *           -----BEGIN RSA PRIVATE KEY-----
     *           <unencrypted_key_value>
     *           -----END RSA PRIVATE KEY-----
     *           </pre>
     *           &#64;InputOnly
     * }
     */
    public function __construct($data = NULL) {
        \GPBMetadata\Google\Appengine\V1\Certificate::initOnce();
        parent::__construct($data);
    }

    /**
     * PEM encoded x.509 public key certificate. This field is set once on
     * certificate creation. Must include the header and footer. Example:
     * <pre>
     * -----BEGIN CERTIFICATE-----
     * <certificate_value>
     * -----END CERTIFICATE-----
     * </pre>
     *
     * Generated from protobuf field <code>string public_certificate = 1;</code>
     * @return string
     */
    public function getPublicCertificate()
    {
        return $this->public_certificate;
    }

    /**
     * PEM encoded x.509 public key certificate. This field is set once on
     * certificate creation. Must include the header and footer. Example:
     * <pre>
     * -----BEGIN CERTIFICATE-----
     * <certificate_value>
     * -----END CERTIFICATE-----
     * </pre>
     *
     * Generated from protobuf field <code>string public_certificate = 1;</code>
     * @param string $var
     * @return $this
     */
    public function setPublicCertificate($var)
    {
        GPBUtil::checkString($var, True);
        $this->public_certificate = $var;

        return $this;
    }

    /**
     * Unencrypted PEM encoded RSA private key. This field is set once on
     * certificate creation and then encrypted. The key size must be 2048
     * bits or fewer. Must include the header and footer. Example:
     * <pre>
     * -----BEGIN RSA PRIVATE KEY-----
     * <unencrypted_key_value>
     * -----END RSA PRIVATE KEY-----
     * </pre>
     * &#64;InputOnly
     *
     * Generated from protobuf field <code>string private_key = 2;</code>
     * @return string
     */
    public function getPrivateKey()
    {
        return $this->private_key;
    }

    /**
     * Unencrypted PEM encoded RSA private key. This field is set once on
     * certificate creation and then encrypted. The key size must be 2048
     * bits or fewer. Must include the header and footer. Example:
     * <pre>
     * -----BEGIN RSA PRIVATE KEY-----
     * <unencrypted_key_value>
     * -----END RSA PRIVATE KEY-----
     * </pre>
     * &#64;InputOnly
     *
     * Generated from protobuf field <code>string private_key = 2;</code>
     * @param string $var
     * @return $this
     */
    public function setPrivateKey($var)
    {
        GPBUtil::checkString($var, True);
        $this->private_key = $var;

        return $this;
    }

}

