syntax = "proto3";

package yandex.cloud.certificatemanager.v1;

import "google/api/annotations.proto";
import "yandex/cloud/validation.proto";

option go_package = "github.com/yandex-cloud/go-genproto/yandex/cloud/certificatemanager/v1;certificatemanager";
option java_package = "yandex.cloud.api.certificatemanager.v1";

// A set of methods for managing certificate content.
service CertificateContentService {
  // Returns chain and private key of the specified certificate.
  rpc Get (GetCertificateContentRequest) returns (GetCertificateContentResponse) {
    option (google.api.http) = { get: "/certificate-manager/v1/certificates/{certificate_id}:getContent" };
  }
}

message GetCertificateContentResponse {
  // ID of the certificate.
  string certificate_id = 1;

  // PEM-encoded certificate chain content of the certificate.
  repeated string certificate_chain = 3;

  // PEM-encoded private key content of the certificate.
  string private_key = 4;
}

message GetCertificateContentRequest {
  // ID of the certificate to download content.
  string certificate_id = 1;
}
