cert_model.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. # Copyright 2020 Baidu, Inc.
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  4. # except in compliance with the License. You may obtain a copy of the License at
  5. #
  6. # http://www.apache.org/licenses/LICENSE-2.0
  7. #
  8. # Unless required by applicable law or agreed to in writing, software distributed under the
  9. # License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  10. # either express or implied. See the License for the specific language governing permissions
  11. # and limitations under the License.
  12. """
  13. This module provides models for CERT-SDK
  14. see more detail in https://cloud.baidu.com/doc/Reference/s/Gjwvz27xu
  15. """
  16. class CertCreateRequest(object):
  17. """
  18. This class define certificate creation information
  19. param: cert_name:
  20. The certificate name.
  21. param: cert_server_data:
  22. The SSL client/server certificate in base-64 format.
  23. param: cert_private_data:
  24. The private key in base-64 format.
  25. param: cert_link_data:
  26. The certificate chain without server certificate.
  27. param: cert_type:
  28. The certificate type,
  29. available values are [1,2] now,
  30. 1 means cert_server_data is a server certificate
  31. 2 means cert_server_data is a client certificate
  32. """
  33. def __init__(self, cert_name, cert_server_data, cert_private_data=None, cert_link_data=None, cert_type=1):
  34. self.certName = cert_name
  35. self.certServerData = cert_server_data
  36. self.certPrivateData = cert_private_data
  37. self.certLinkData = cert_link_data
  38. self.certType = cert_type