2
0

CryptoKey.xml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CryptoKey" inherits="Resource" version="3.4">
  3. <brief_description>
  4. A cryptographic key (RSA).
  5. </brief_description>
  6. <description>
  7. The CryptoKey class represents a cryptographic key. Keys can be loaded and saved like any other [Resource].
  8. They can be used to generate a self-signed [X509Certificate] via [method Crypto.generate_self_signed_certificate] and as private key in [method StreamPeerSSL.accept_stream] along with the appropriate certificate.
  9. [b]Note:[/b] Not available in HTML5 exports.
  10. </description>
  11. <tutorials>
  12. </tutorials>
  13. <methods>
  14. <method name="is_public_only" qualifiers="const">
  15. <return type="bool">
  16. </return>
  17. <description>
  18. Return [code]true[/code] if this CryptoKey only has the public part, and not the private one.
  19. </description>
  20. </method>
  21. <method name="load">
  22. <return type="int" enum="Error">
  23. </return>
  24. <argument index="0" name="path" type="String">
  25. </argument>
  26. <argument index="1" name="public_only" type="bool" default="false">
  27. </argument>
  28. <description>
  29. Loads a key from [code]path[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be loaded.
  30. [b]Note[/b]: [code]path[/code] should should be a "*.pub" file if [code]public_only[/code] is [code]true[/code], a "*.key" file otherwise.
  31. </description>
  32. </method>
  33. <method name="load_from_string">
  34. <return type="int" enum="Error">
  35. </return>
  36. <argument index="0" name="string_key" type="String">
  37. </argument>
  38. <argument index="1" name="public_only" type="bool" default="false">
  39. </argument>
  40. <description>
  41. Loads a key from the given [code]string[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be loaded.
  42. </description>
  43. </method>
  44. <method name="save">
  45. <return type="int" enum="Error">
  46. </return>
  47. <argument index="0" name="path" type="String">
  48. </argument>
  49. <argument index="1" name="public_only" type="bool" default="false">
  50. </argument>
  51. <description>
  52. Saves a key to the given [code]path[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be saved.
  53. [b]Note[/b]: [code]path[/code] should should be a "*.pub" file if [code]public_only[/code] is [code]true[/code], a "*.key" file otherwise.
  54. </description>
  55. </method>
  56. <method name="save_to_string">
  57. <return type="String">
  58. </return>
  59. <argument index="0" name="public_only" type="bool" default="false">
  60. </argument>
  61. <description>
  62. Returns a string containing the key in PEM format. If [code]public_only[/code] is [code]true[/code], only the public key will be included.
  63. </description>
  64. </method>
  65. </methods>
  66. <constants>
  67. </constants>
  68. </class>