# Generated by the protocol buffer compiler.  DO NOT EDIT!

from google.protobuf import descriptor
from google.protobuf import message
from google.protobuf import reflection
from google.protobuf import descriptor_pb2
# @@protoc_insertion_point(imports)



DESCRIPTOR = descriptor.FileDescriptor(
  name='cert-request.proto',
  package='',
  serialized_pb='\n\x12\x63\x65rt-request.proto\"\xe5\x01\n\x19\x43\x65rtificateRequestMessage\x12?\n\x07\x63ommand\x18\xdf\x01 \x02(\x0b\x32-.CertificateRequestMessage.CertificateRequest\x1a\x1a\n\x04Name\x12\x12\n\ncomponents\x18\x08 \x03(\x0c\x1ak\n\x12\x43\x65rtificateRequest\x12\x31\n\x07keyName\x18\xdc\x01 \x02(\x0b\x32\x1f.CertificateRequestMessage.Name\x12\x10\n\x07keyType\x18\xdd\x01 \x02(\r\x12\x10\n\x07keyBits\x18\xde\x01 \x02(\x0c')




_CERTIFICATEREQUESTMESSAGE_NAME = descriptor.Descriptor(
  name='Name',
  full_name='CertificateRequestMessage.Name',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    descriptor.FieldDescriptor(
      name='components', full_name='CertificateRequestMessage.Name.components', index=0,
      number=8, type=12, cpp_type=9, label=3,
      has_default_value=False, default_value=[],
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  extension_ranges=[],
  serialized_start=117,
  serialized_end=143,
)

_CERTIFICATEREQUESTMESSAGE_CERTIFICATEREQUEST = descriptor.Descriptor(
  name='CertificateRequest',
  full_name='CertificateRequestMessage.CertificateRequest',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    descriptor.FieldDescriptor(
      name='keyName', full_name='CertificateRequestMessage.CertificateRequest.keyName', index=0,
      number=220, type=11, cpp_type=10, label=2,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    descriptor.FieldDescriptor(
      name='keyType', full_name='CertificateRequestMessage.CertificateRequest.keyType', index=1,
      number=221, type=13, cpp_type=3, label=2,
      has_default_value=False, default_value=0,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
    descriptor.FieldDescriptor(
      name='keyBits', full_name='CertificateRequestMessage.CertificateRequest.keyBits', index=2,
      number=222, type=12, cpp_type=9, label=2,
      has_default_value=False, default_value="",
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  extension_ranges=[],
  serialized_start=145,
  serialized_end=252,
)

_CERTIFICATEREQUESTMESSAGE = descriptor.Descriptor(
  name='CertificateRequestMessage',
  full_name='CertificateRequestMessage',
  filename=None,
  file=DESCRIPTOR,
  containing_type=None,
  fields=[
    descriptor.FieldDescriptor(
      name='command', full_name='CertificateRequestMessage.command', index=0,
      number=223, type=11, cpp_type=10, label=2,
      has_default_value=False, default_value=None,
      message_type=None, enum_type=None, containing_type=None,
      is_extension=False, extension_scope=None,
      options=None),
  ],
  extensions=[
  ],
  nested_types=[_CERTIFICATEREQUESTMESSAGE_NAME, _CERTIFICATEREQUESTMESSAGE_CERTIFICATEREQUEST, ],
  enum_types=[
  ],
  options=None,
  is_extendable=False,
  extension_ranges=[],
  serialized_start=23,
  serialized_end=252,
)

_CERTIFICATEREQUESTMESSAGE_NAME.containing_type = _CERTIFICATEREQUESTMESSAGE;
_CERTIFICATEREQUESTMESSAGE_CERTIFICATEREQUEST.fields_by_name['keyName'].message_type = _CERTIFICATEREQUESTMESSAGE_NAME
_CERTIFICATEREQUESTMESSAGE_CERTIFICATEREQUEST.containing_type = _CERTIFICATEREQUESTMESSAGE;
_CERTIFICATEREQUESTMESSAGE.fields_by_name['command'].message_type = _CERTIFICATEREQUESTMESSAGE_CERTIFICATEREQUEST
DESCRIPTOR.message_types_by_name['CertificateRequestMessage'] = _CERTIFICATEREQUESTMESSAGE

class CertificateRequestMessage(message.Message):
  __metaclass__ = reflection.GeneratedProtocolMessageType
  
  class Name(message.Message):
    __metaclass__ = reflection.GeneratedProtocolMessageType
    DESCRIPTOR = _CERTIFICATEREQUESTMESSAGE_NAME
    
    # @@protoc_insertion_point(class_scope:CertificateRequestMessage.Name)
  
  class CertificateRequest(message.Message):
    __metaclass__ = reflection.GeneratedProtocolMessageType
    DESCRIPTOR = _CERTIFICATEREQUESTMESSAGE_CERTIFICATEREQUEST
    
    # @@protoc_insertion_point(class_scope:CertificateRequestMessage.CertificateRequest)
  DESCRIPTOR = _CERTIFICATEREQUESTMESSAGE
  
  # @@protoc_insertion_point(class_scope:CertificateRequestMessage)

# @@protoc_insertion_point(module_scope)
