A protocol that should be implemented by 3rd-party libraries implementing TLS.
More...
#import <ObjFW/OFTLSSocket.h>
A protocol that should be implemented by 3rd-party libraries implementing TLS.
Returns the path of the X.509 certificate file used by the TLS socket.
- Returns
- The path of the X.509 certificate file used by the TLS socket
Returns the path of the X.509 certificate file used by the TLS socket for the specified SNI host.
- Parameters
-
SNIHost | The SNI host for which the path of the X.509 certificate file should be returned |
- Returns
- The path of the X.509 certificate file used by the TLS socket for the specified SNI host
Returns the delegate used by the TLS socket.
- Returns
- The delegate used by the TLS socket
Initializes the TLS socket with the specified TCP socket as its underlying socket.
- Parameters
-
socket | The TCP socket to use as underlying socket |
- (bool) isCertificateVerificationEnabled |
|
|
|
Returns whether certificate verification is enabled.
- Returns
- Whether certificate verification is enabled
Returns the path of the PKCS#8 private key file used by the TLS socket.
- Returns
- The path of the PKCS#8 private key file used by the TLS socket
Returns the path of the PKCS#8 private key file used by the TLS socket for the specified SNI host.
- Parameters
-
SNIHost | The SNI host for which the path of the PKCS#8 private key file should be returned |
- Returns
- The path of the PKCS#8 private key file used by the TLS socket for the specified SNI host
- (nullable const char*) privateKeyPassphrase |
|
|
|
Returns the passphrase to decrypt the PKCS#8 private key file.
- Warning
- You should not copy this to insecure memory which is swappable!
- Returns
- The passphrase to decrypt the PKCS#8 private key file
- (nullable const char*) privateKeyPassphraseForSNIHost: |
|
(OFString *) |
SNIHost |
|
Returns the passphrase to decrypt the PKCS#8 private key file for the specified SNI host.
- Warning
- You should not copy this to insecure memory which is swappable!
- Parameters
-
SNIHost | The SNI host for which the passphrase to decrypt the PKCS#8 private key file should be returned |
- Returns
- The passphrase to decrypt the PKCS#8 private key file for the specified SNI host
- (void) setCertificateFile: |
|
(nullable OFString *) |
certificateFile |
|
Sets the path to the X.509 certificate file to use.
- Parameters
-
certificateFile | The path to the X.509 certificate file |
Sets the path to the X.509 certificate file to use for the specified SNI host.
- Parameters
-
SNIHost | The SNI host for which the path of the X.509 certificate file should be set |
certificateFile | The path to the X.509 certificate file |
- (void) setCertificateVerificationEnabled: |
|
(bool) |
enabled |
|
Enable or disable certificate verification.
The default is enabled.
- Parameters
-
enabled | Whether to enable or disable certificate verification |
Sets a delegate for the TLS socket.
- Parameters
-
delegate | The delegate to use |
- (void) setPrivateKeyFile: |
|
(nullable OFString *) |
privateKeyFile |
|
Sets the path to the PKCS#8 private key file to use.
- Parameters
-
privateKeyFile | The path to the PKCS#8 private key file |
Sets the path to the PKCS#8 private key file to use for the specified SNI host.
- Parameters
-
privateKeyFile | The path to the PKCS#8 private key file |
SNIHost | The SNI host for which the path to the PKCS#8 private key file should be set |
- (void) setPrivateKeyPassphrase: |
|
(nullable const char *) |
privateKeyPassphrase |
|
Sets the passphrase to decrypt the PKCS#8 private key file.
- Warning
- You have to ensure that this is in secure memory protected from swapping! This is also the reason why this is not an OFString.
- Parameters
-
privateKeyPassphrase | The passphrase to decrypt the PKCS#8 private key file |
Sets the passphrase to decrypt the PKCS#8 private key file for the specified SNI host.
- Warning
- You have to ensure that this is in secure memory protected from swapping! This is also the reason why this is not an OFString.
- Parameters
-
privateKeyPassphrase | The passphrase to decrypt the PKCS#8 private key file for the specified SNI host |
SNIHost | The SNI host for which the passphrase to decrypt the PKCS#8 private key file should be set |
- (void) startTLSWithExpectedHost: |
|
(OFString *) |
host |
|
Initiates the TLS handshake.
- Note
- This is only useful if you used initWithSocket: to start TLS on a TCP socket which is already connected!
- Parameters
-
host | The host to expect for certificate verification. May be nil if certificate verification is disabled. |
The documentation for this protocol was generated from the following file: