pandemonium_engine_docs/classes/class_cryptokey.rst

87 lines
5.0 KiB
ReStructuredText

:github_url: hide
.. DO NOT EDIT THIS FILE!!!
.. Generated automatically from Godot engine sources.
.. Generator: https://github.com/godotengine/godot/tree/3.5/doc/tools/make_rst.py.
.. XML source: https://github.com/godotengine/godot/tree/3.5/doc/classes/CryptoKey.xml.
.. _class_CryptoKey:
CryptoKey
=========
**Inherits:** :ref:`Resource<class_Resource>` **<** :ref:`Reference<class_Reference>` **<** :ref:`Object<class_Object>`
A cryptographic key (RSA).
Description
-----------
The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other :ref:`Resource<class_Resource>`.
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.
Methods
-------
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`bool<class_bool>` | :ref:`is_public_only<class_CryptoKey_method_is_public_only>` **(** **)** |const| |
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`load<class_CryptoKey_method_load>` **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)** |
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :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 **)** |
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`Error<enum_@GlobalScope_Error>` | :ref:`save<class_CryptoKey_method_save>` **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)** |
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
| :ref:`String<class_String>` | :ref:`save_to_string<class_CryptoKey_method_save_to_string>` **(** :ref:`bool<class_bool>` public_only=false **)** |
+---------------------------------------+----------------------------------------------------------------------------------------------------------------------------------------------------------------+
Method Descriptions
-------------------
.. _class_CryptoKey_method_is_public_only:
- :ref:`bool<class_bool>` **is_public_only** **(** **)** |const|
Return ``true`` if this CryptoKey only has the public part, and not the private one.
----
.. _class_CryptoKey_method_load:
- :ref:`Error<enum_@GlobalScope_Error>` **load** **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)**
Loads a key from ``path``. If ``public_only`` is ``true``, only the public key will be loaded.
\ **Note:** ``path`` should be a "\*.pub" file if ``public_only`` is ``true``, a "\*.key" file otherwise.
----
.. _class_CryptoKey_method_load_from_string:
- :ref:`Error<enum_@GlobalScope_Error>` **load_from_string** **(** :ref:`String<class_String>` string_key, :ref:`bool<class_bool>` public_only=false **)**
Loads a key from the given ``string``. If ``public_only`` is ``true``, only the public key will be loaded.
----
.. _class_CryptoKey_method_save:
- :ref:`Error<enum_@GlobalScope_Error>` **save** **(** :ref:`String<class_String>` path, :ref:`bool<class_bool>` public_only=false **)**
Saves a key to the given ``path``. If ``public_only`` is ``true``, only the public key will be saved.
\ **Note:** ``path`` should be a "\*.pub" file if ``public_only`` is ``true``, a "\*.key" file otherwise.
----
.. _class_CryptoKey_method_save_to_string:
- :ref:`String<class_String>` **save_to_string** **(** :ref:`bool<class_bool>` public_only=false **)**
Returns a string containing the key in PEM format. If ``public_only`` is ``true``, only the public key will be included.
.. |virtual| replace:: :abbr:`virtual (This method should typically be overridden by the user to have any effect.)`
.. |const| replace:: :abbr:`const (This method has no side effects. It doesn't modify any of the instance's member variables.)`
.. |vararg| replace:: :abbr:`vararg (This method accepts any number of arguments after the ones described here.)`