class_cryptokey.rst 5.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/master/doc/tools/make_rst.py.
  5. .. XML source: https://github.com/godotengine/godot/tree/master/doc/classes/CryptoKey.xml.
  6. .. _class_CryptoKey:
  7. CryptoKey
  8. =========
  9. **Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`RefCounted<class_RefCounted>` **<** :ref:`Object<class_Object>`
  10. A cryptographic key (RSA).
  11. Description
  12. -----------
  13. The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other :ref:`Resource<class_Resource>`.
  14. 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:`StreamPeerTLS.accept_stream<class_StreamPeerTLS_method_accept_stream>` along with the appropriate certificate.
  15. Methods
  16. -------
  17. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  18. | :ref:`bool<class_bool>` | :ref:`is_public_only<class_CryptoKey_method_is_public_only>` **(** **)** |const| |
  19. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  20. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load<class_CryptoKey_method_load>` **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)** |
  21. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  22. | :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 **)** |
  23. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  24. | :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save<class_CryptoKey_method_save>` **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)** |
  25. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  26. | :ref:`String<class_String>` | :ref:`save_to_string<class_CryptoKey_method_save_to_string>` **(** :ref:`bool<class_bool>` public_only=false **)** |
  27. +---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
  28. Method Descriptions
  29. -------------------
  30. .. _class_CryptoKey_method_is_public_only:
  31. - :ref:`bool<class_bool>` **is_public_only** **(** **)** |const|
  32. Returns ``true`` if this CryptoKey only has the public part, and not the private one.
  33. ----
  34. .. _class_CryptoKey_method_load:
  35. - :ref:`Error<enum_@GlobalScope_Error>` **load** **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)**
  36. Loads a key from ``path``. If ``public_only`` is ``true``, only the public key will be loaded.
  37. \ **Note:** ``path`` should be a "\*.pub" file if ``public_only`` is ``true``, a "\*.key" file otherwise.
  38. ----
  39. .. _class_CryptoKey_method_load_from_string:
  40. - :ref:`Error<enum_@GlobalScope_Error>` **load_from_string** **(** :ref:`String<class_String>` string_key, :ref:`bool<class_bool>` public_only=false **)**
  41. Loads a key from the given ``string_key``. If ``public_only`` is ``true``, only the public key will be loaded.
  42. ----
  43. .. _class_CryptoKey_method_save:
  44. - :ref:`Error<enum_@GlobalScope_Error>` **save** **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)**
  45. Saves a key to the given ``path``. If ``public_only`` is ``true``, only the public key will be saved.
  46. \ **Note:** ``path`` should be a "\*.pub" file if ``public_only`` is ``true``, a "\*.key" file otherwise.
  47. ----
  48. .. _class_CryptoKey_method_save_to_string:
  49. - :ref:`String<class_String>` **save_to_string** **(** :ref:`bool<class_bool>` public_only=false **)**
  50. Returns a string containing the key in PEM format. If ``public_only`` is ``true``, only the public key will be included.
  51. .. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
  52. .. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
  53. .. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`
  54. .. |constructor| replace:: :abbr:`constructor (This method is used to construct a type.)`
  55. .. |static| replace:: :abbr:`static (This method doesn't need an instance to be called, so it can be called directly using the class name.)`
  56. .. |operator| replace:: :abbr:`operator (This method describes a valid operator to use with this type as left-hand operand.)`