class_x509certificate.rst 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. :github_url: hide
  2. .. DO NOT EDIT THIS FILE!!!
  3. .. Generated automatically from Godot engine sources.
  4. .. Generator: https://github.com/godotengine/godot/tree/4.2/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/4.2/doc/classes/X509Certificate.xml.
  6. .. _class_X509Certificate:
  7. X509Certificate
  8. ===============
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. An X509 certificate (e.g. for TLS).
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other :ref:`Resource<class_Resource>`.
  15. They can be used as the server certificate in :ref:`StreamPeerTLS.accept_stream<class_StreamPeerTLS_method_accept_stream>` (along with the proper :ref:`CryptoKey<class_CryptoKey>`), and to specify the only certificate that should be accepted when connecting to a TLS server via :ref:`StreamPeerTLS.connect_to_stream<class_StreamPeerTLS_method_connect_to_stream>`.
  16. .. rst-class:: classref-introduction-group
  17. Tutorials
  18. ---------
  19. - :doc:`SSL certificates <../tutorials/networking/ssl_certificates>`
  20. .. rst-class:: classref-reftable-group
  21. Methods
  22. -------
  23. .. table::
  24. :widths: auto
  25. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load<class_X509Certificate_method_load>` **(** :ref:`String<class_String>` path **)** |
  27. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_from_string<class_X509Certificate_method_load_from_string>` **(** :ref:`String<class_String>` string **)** |
  29. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save<class_X509Certificate_method_save>` **(** :ref:`String<class_String>` path **)** |
  31. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------+
  32. | :ref:`String<class_String>` | :ref:`save_to_string<class_X509Certificate_method_save_to_string>` **(** **)** |
  33. +---------------------------------------+-----------------------------------------------------------------------------------------------------------------------+
  34. .. rst-class:: classref-section-separator
  35. ----
  36. .. rst-class:: classref-descriptions-group
  37. Method Descriptions
  38. -------------------
  39. .. _class_X509Certificate_method_load:
  40. .. rst-class:: classref-method
  41. :ref:`Error<enum_@GlobalScope_Error>` **load** **(** :ref:`String<class_String>` path **)**
  42. Loads a certificate from ``path`` ("\*.crt" file).
  43. .. rst-class:: classref-item-separator
  44. ----
  45. .. _class_X509Certificate_method_load_from_string:
  46. .. rst-class:: classref-method
  47. :ref:`Error<enum_@GlobalScope_Error>` **load_from_string** **(** :ref:`String<class_String>` string **)**
  48. Loads a certificate from the given ``string``.
  49. .. rst-class:: classref-item-separator
  50. ----
  51. .. _class_X509Certificate_method_save:
  52. .. rst-class:: classref-method
  53. :ref:`Error<enum_@GlobalScope_Error>` **save** **(** :ref:`String<class_String>` path **)**
  54. Saves a certificate to the given ``path`` (should be a "\*.crt" file).
  55. .. rst-class:: classref-item-separator
  56. ----
  57. .. _class_X509Certificate_method_save_to_string:
  58. .. rst-class:: classref-method
  59. :ref:`String<class_String>` **save_to_string** **(** **)**
  60. Returns a string representation of the certificate, or an empty string if the certificate is invalid.
  61. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  62. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  63. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  64. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  65. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  66. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`
  67. .. |bitfield| replace:: :abbr:`BitField (This value is an integer composed as a bitmask of the following flags.)`