CryptoKey.xml 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <class name="CryptoKey" inherits="Resource" version="3.6" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../class.xsd">
  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. </description>
  10. <tutorials>
  11. </tutorials>
  12. <methods>
  13. <method name="is_public_only" qualifiers="const">
  14. <return type="bool" />
  15. <description>
  16. Return [code]true[/code] if this CryptoKey only has the public part, and not the private one.
  17. </description>
  18. </method>
  19. <method name="load">
  20. <return type="int" enum="Error" />
  21. <argument index="0" name="path" type="String" />
  22. <argument index="1" name="public_only" type="bool" default="false" />
  23. <description>
  24. Loads a key from [code]path[/code]. If [code]public_only[/code] is [code]true[/code], only the public key will be loaded.
  25. [b]Note:[/b] [code]path[/code] should be a "*.pub" file if [code]public_only[/code] is [code]true[/code], a "*.key" file otherwise.
  26. </description>
  27. </method>
  28. <method name="load_from_string">
  29. <return type="int" enum="Error" />
  30. <argument index="0" name="string_key" type="String" />
  31. <argument index="1" name="public_only" type="bool" default="false" />
  32. <description>
  33. 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.
  34. </description>
  35. </method>
  36. <method name="save">
  37. <return type="int" enum="Error" />
  38. <argument index="0" name="path" type="String" />
  39. <argument index="1" name="public_only" type="bool" default="false" />
  40. <description>
  41. 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.
  42. [b]Note:[/b] [code]path[/code] should be a "*.pub" file if [code]public_only[/code] is [code]true[/code], a "*.key" file otherwise.
  43. </description>
  44. </method>
  45. <method name="save_to_string">
  46. <return type="String" />
  47. <argument index="0" name="public_only" type="bool" default="false" />
  48. <description>
  49. 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.
  50. </description>
  51. </method>
  52. </methods>
  53. <constants>
  54. </constants>
  55. </class>