2019-08-22 20:49:30 +08:00
<?xml version="1.0" encoding="UTF-8" ?>
2023-07-06 16:08:05 +08:00
<class name= "X509Certificate" inherits= "Resource" xmlns:xsi= "http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation= "../class.xsd" >
2019-08-22 20:49:30 +08:00
<brief_description >
2022-09-07 14:25:47 +08:00
An X509 certificate (e.g. for TLS).
2019-08-22 20:49:30 +08:00
</brief_description>
<description >
2019-09-24 00:16:41 +08:00
The X509Certificate class represents an X509 certificate. Certificates can be loaded and saved like any other [Resource].
2023-05-02 06:09:49 +08:00
They can be used as the server certificate in [method StreamPeerTLS.accept_stream] (along with the proper [CryptoKey]), and to specify the only certificate that should be accepted when connecting to a TLS server via [method StreamPeerTLS.connect_to_stream].
2019-08-22 20:49:30 +08:00
</description>
<tutorials >
2023-08-15 18:14:01 +08:00
<link title= "SSL certificates" > $DOCS_URL/tutorials/networking/ssl_certificates.html</link>
2019-08-22 20:49:30 +08:00
</tutorials>
<methods >
<method name= "load" >
2021-07-30 21:28:05 +08:00
<return type= "int" enum= "Error" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "path" type= "String" />
2019-08-22 20:49:30 +08:00
<description >
2022-08-09 07:41:07 +08:00
Loads a certificate from [param path] ("*.crt" file).
2019-08-22 20:49:30 +08:00
</description>
</method>
2023-04-06 05:45:55 +08:00
<method name= "load_from_string" >
<return type= "int" enum= "Error" />
<param index= "0" name= "string" type= "String" />
<description >
Loads a certificate from the given [param string].
</description>
</method>
2019-08-22 20:49:30 +08:00
<method name= "save" >
2021-07-30 21:28:05 +08:00
<return type= "int" enum= "Error" />
2022-08-07 02:11:48 +08:00
<param index= "0" name= "path" type= "String" />
2019-08-22 20:49:30 +08:00
<description >
2022-08-09 07:41:07 +08:00
Saves a certificate to the given [param path] (should be a "*.crt" file).
2019-08-22 20:49:30 +08:00
</description>
</method>
2023-04-06 05:45:55 +08:00
<method name= "save_to_string" >
<return type= "String" />
<description >
Returns a string representation of the certificate, or an empty string if the certificate is invalid.
</description>
</method>
2019-08-22 20:49:30 +08:00
</methods>
</class>