class_cryptokey.rst 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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/3.6/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/3.6/doc/classes/CryptoKey.xml.
  6. .. _class_CryptoKey:
  7. CryptoKey
  8. =========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
  10. A cryptographic key (RSA).
  11. .. rst-class:: classref-introduction-group
  12. Description
  13. -----------
  14. The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other :ref:`Resource<class_Resource>`.
  15. They can be used to generate a self-signed :ref:`X509Certificate<class_X509Certificate>` via :ref:`Crypto.generate_self_signed_certificate<class_Crypto_method_generate_self_signed_certificate>` and as private key in :ref:`StreamPeerSSL.accept_stream<class_StreamPeerSSL_method_accept_stream>` along with the appropriate certificate.
  16. .. rst-class:: classref-reftable-group
  17. Methods
  18. -------
  19. .. table::
  20. :widths: auto
  21. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :ref:`bool<class_bool>` | :ref:`is_public_only<class_CryptoKey_method_is_public_only>` **(** **)** |const| |
  23. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load<class_CryptoKey_method_load>` **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)** |
  25. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load_from_string<class_CryptoKey_method_load_from_string>` **(** :ref:`String<class_String>` string_key, :ref:`bool<class_bool>` public_only=false **)** |
  27. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save<class_CryptoKey_method_save>` **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)** |
  29. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  30. | :ref:`String<class_String>` | :ref:`save_to_string<class_CryptoKey_method_save_to_string>` **(** :ref:`bool<class_bool>` public_only=false **)** |
  31. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  32. .. rst-class:: classref-section-separator
  33. ----
  34. .. rst-class:: classref-descriptions-group
  35. Method Descriptions
  36. -------------------
  37. .. _class_CryptoKey_method_is_public_only:
  38. .. rst-class:: classref-method
  39. :ref:`bool<class_bool>` **is_public_only** **(** **)** |const|
  40. Return ``true`` if this CryptoKey only has the public part, and not the private one.
  41. .. rst-class:: classref-item-separator
  42. ----
  43. .. _class_CryptoKey_method_load:
  44. .. rst-class:: classref-method
  45. :ref:`Error<enum_@GlobalScope_Error>` **load** **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)**
  46. Loads a key from ``path``. If ``public_only`` is ``true``, only the public key will be loaded.
  47. \ **Note:** ``path`` should be a "\*.pub" file if ``public_only`` is ``true``, a "\*.key" file otherwise.
  48. .. rst-class:: classref-item-separator
  49. ----
  50. .. _class_CryptoKey_method_load_from_string:
  51. .. rst-class:: classref-method
  52. :ref:`Error<enum_@GlobalScope_Error>` **load_from_string** **(** :ref:`String<class_String>` string_key, :ref:`bool<class_bool>` public_only=false **)**
  53. Loads a key from the given ``string``. If ``public_only`` is ``true``, only the public key will be loaded.
  54. .. rst-class:: classref-item-separator
  55. ----
  56. .. _class_CryptoKey_method_save:
  57. .. rst-class:: classref-method
  58. :ref:`Error<enum_@GlobalScope_Error>` **save** **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)**
  59. Saves a key to the given ``path``. If ``public_only`` is ``true``, only the public key will be saved.
  60. \ **Note:** ``path`` should be a "\*.pub" file if ``public_only`` is ``true``, a "\*.key" file otherwise.
  61. .. rst-class:: classref-item-separator
  62. ----
  63. .. _class_CryptoKey_method_save_to_string:
  64. .. rst-class:: classref-method
  65. :ref:`String<class_String>` **save_to_string** **(** :ref:`bool<class_bool>` public_only=false **)**
  66. Returns a string containing the key in PEM format. If ``public_only`` is ``true``, only the public key will be included.
  67. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  68. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  69. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  70. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`