예제 #1
0
  def _SignCsr(self, issuer_ref, csr, lifetime):
    """Issues a certificate under the given issuer with the given settings."""
    certificate_id = 'subordinate-{}'.format(certificate_utils.GenerateCertId())
    certificate_name = '{}/certificates/{}'.format(issuer_ref.RelativeName(),
                                                   certificate_id)
    cert_request = self.messages.PrivatecaProjectsLocationsCertificateAuthoritiesCertificatesCreateRequest(
        certificateId=certificate_id,
        parent=issuer_ref.RelativeName(),
        requestId=request_utils.GenerateRequestId(),
        certificate=self.messages.Certificate(
            name=certificate_name, lifetime=lifetime, pemCsr=csr))

    return self.client.projects_locations_certificateAuthorities_certificates.Create(
        cert_request)
예제 #2
0
 def FallthroughFn():
     cls.id_fallthrough_was_used = True
     return certificate_utils.GenerateCertId()