2002-06-06 14:02:59 +00:00
|
|
|
|
/** Interface for NSFileHandle for GNUStep
|
1997-09-01 21:59:51 +00:00
|
|
|
|
Copyright (C) 1997 Free Software Foundation, Inc.
|
|
|
|
|
|
|
|
|
|
Written by: Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
|
|
|
|
Date: 1997
|
|
|
|
|
|
|
|
|
|
This file is part of the GNUstep Base Library.
|
|
|
|
|
|
|
|
|
|
This library is free software; you can redistribute it and/or
|
2007-09-14 11:36:11 +00:00
|
|
|
|
modify it under the terms of the GNU Lesser General Public
|
1997-09-01 21:59:51 +00:00
|
|
|
|
License as published by the Free Software Foundation; either
|
2008-06-08 10:38:33 +00:00
|
|
|
|
version 2 of the License, or (at your option) any later version.
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
This library is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
|
Library General Public License for more details.
|
|
|
|
|
|
2007-09-14 11:36:11 +00:00
|
|
|
|
You should have received a copy of the GNU Lesser General Public
|
1997-09-01 21:59:51 +00:00
|
|
|
|
License along with this library; if not, write to the Free
|
2006-10-31 07:05:46 +00:00
|
|
|
|
Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
|
|
|
Boston, MA 02111 USA.
|
2002-06-06 14:02:59 +00:00
|
|
|
|
|
|
|
|
|
AutogsdocSource: NSFileHandle.m
|
|
|
|
|
AutogsdocSource: NSPipe.m
|
1997-09-01 21:59:51 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __NSFileHandle_h_GNUSTEP_BASE_INCLUDE
|
|
|
|
|
#define __NSFileHandle_h_GNUSTEP_BASE_INCLUDE
|
2006-10-31 07:05:46 +00:00
|
|
|
|
#import <GNUstepBase/GSVersionMacros.h>
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
|
#import <Foundation/NSObject.h>
|
|
|
|
|
#import <Foundation/NSRange.h>
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
|
@class NSData;
|
|
|
|
|
@class NSString;
|
|
|
|
|
|
1997-09-01 21:59:51 +00:00
|
|
|
|
@interface NSFileHandle : NSObject
|
|
|
|
|
|
|
|
|
|
// Allocating and Initializing a FileHandle Object
|
|
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
|
+ (id) fileHandleForReadingAtPath: (NSString*)path;
|
|
|
|
|
+ (id) fileHandleForWritingAtPath: (NSString*)path;
|
|
|
|
|
+ (id) fileHandleForUpdatingAtPath: (NSString*)path;
|
|
|
|
|
+ (id) fileHandleWithStandardError;
|
|
|
|
|
+ (id) fileHandleWithStandardInput;
|
|
|
|
|
+ (id) fileHandleWithStandardOutput;
|
|
|
|
|
+ (id) fileHandleWithNullDevice;
|
|
|
|
|
|
|
|
|
|
- (id) initWithFileDescriptor: (int)desc;
|
|
|
|
|
- (id) initWithFileDescriptor: (int)desc closeOnDealloc: (BOOL)flag;
|
|
|
|
|
- (id) initWithNativeHandle: (void*)hdl;
|
|
|
|
|
- (id) initWithNativeHandle: (void*)hdl closeOnDealloc: (BOOL)flag;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
// Returning file handles
|
|
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (int) fileDescriptor;
|
|
|
|
|
- (void*) nativeHandle;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
// Synchronous I/O operations
|
|
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (NSData*) availableData;
|
|
|
|
|
- (NSData*) readDataToEndOfFile;
|
|
|
|
|
- (NSData*) readDataOfLength: (unsigned int)len;
|
|
|
|
|
- (void) writeData: (NSData*)item;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
// Asynchronous I/O operations
|
|
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (void) acceptConnectionInBackgroundAndNotify;
|
2002-06-23 19:53:15 +00:00
|
|
|
|
- (void) acceptConnectionInBackgroundAndNotifyForModes: (NSArray*)modes;
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (void) readInBackgroundAndNotify;
|
2002-06-23 19:53:15 +00:00
|
|
|
|
- (void) readInBackgroundAndNotifyForModes: (NSArray*)modes;
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (void) readToEndOfFileInBackgroundAndNotify;
|
2002-06-23 19:53:15 +00:00
|
|
|
|
- (void) readToEndOfFileInBackgroundAndNotifyForModes: (NSArray*)modes;
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (void) waitForDataInBackgroundAndNotify;
|
2002-06-23 19:53:15 +00:00
|
|
|
|
- (void) waitForDataInBackgroundAndNotifyForModes: (NSArray*)modes;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
// Seeking within a file
|
|
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (unsigned long long) offsetInFile;
|
|
|
|
|
- (unsigned long long) seekToEndOfFile;
|
|
|
|
|
- (void) seekToFileOffset: (unsigned long long)pos;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
// Operations on file
|
|
|
|
|
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (void) closeFile;
|
|
|
|
|
- (void) synchronizeFile;
|
|
|
|
|
- (void) truncateFileAtOffset: (unsigned long long)pos;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
// Notification names.
|
|
|
|
|
|
2004-07-29 15:30:47 +00:00
|
|
|
|
/**
|
|
|
|
|
* Posted when one of the [NSFileHandle] methods
|
|
|
|
|
* <code>acceptConnectionInBackground...</code> succeeds and has connected to a
|
|
|
|
|
* stream-type socket in another process. The notification's
|
|
|
|
|
* <em>userInfo</em> dictionary will contain the [NSFileHandle] for the near
|
|
|
|
|
* end of the connection (associated to the key
|
|
|
|
|
* '<code>NSFileHandleNotificationFileHandleItem</code>').
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const NSFileHandleConnectionAcceptedNotification;
|
2004-07-29 15:30:47 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Posted when one of the [NSFileHandle] methods
|
|
|
|
|
* <code>waitForDataInBackground...</code> has been informed that data is
|
|
|
|
|
* available. The receiving [NSFileHandle] is passed in the notification.
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const NSFileHandleDataAvailableNotification;
|
2004-07-29 15:30:47 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Posted when one of the [NSFileHandle] methods readDataInBackground... has
|
|
|
|
|
* consumed data. The receiving [NSFileHandle] is passed in the
|
|
|
|
|
* notification's <em>userInfo</em> dictionary associated to the key
|
|
|
|
|
* '<code>NSFileHandleNotificationDataItem</code>'.
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const NSFileHandleReadCompletionNotification;
|
2004-07-29 15:30:47 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Posted when one of the [NSFileHandle] methods
|
|
|
|
|
* <code>readToEndOfFileInBackground...</code> has finished. The receiving
|
|
|
|
|
* [NSFileHandle] is passed in the notification's <em>userInfo</em> dictionary
|
|
|
|
|
* associated to the key '<code>NSFileHandleNotificationDataItem</code>'.
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const NSFileHandleReadToEndOfFileCompletionNotification;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
// Keys for accessing userInfo dictionary in notification handlers.
|
|
|
|
|
|
2004-07-29 15:30:47 +00:00
|
|
|
|
/**
|
2004-08-02 18:10:58 +00:00
|
|
|
|
* Dictionary key for [NSFileHandle] notifications used to access an
|
2004-09-19 23:24:36 +00:00
|
|
|
|
* [NSData] object containing received data.
|
2004-07-29 15:30:47 +00:00
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const NSFileHandleNotificationDataItem;
|
2004-07-29 15:30:47 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Dictionary key for [NSFileHandle] notifications used to mark the
|
|
|
|
|
* [NSFileHandle] that has established a stream-socket connection.
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const NSFileHandleNotificationFileHandleItem;
|
2004-07-29 15:30:47 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Dictionary key for [NSFileHandle] notifications postable to certain run
|
|
|
|
|
* loop modes, associated to an NSArray containing the modes allowed.
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const NSFileHandleNotificationMonitorModes;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
// Exceptions
|
|
|
|
|
|
2004-07-29 15:30:47 +00:00
|
|
|
|
/**
|
|
|
|
|
* Exception raised when attempts to read from an [NSFileHandle] channel fail.
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const NSFileHandleOperationException;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
|
|
|
|
@interface NSPipe : NSObject
|
|
|
|
|
{
|
2010-02-14 10:48:10 +00:00
|
|
|
|
#if GS_EXPOSE(NSPipe)
|
|
|
|
|
@private
|
|
|
|
|
NSFileHandle *_readHandle;
|
|
|
|
|
NSFileHandle *_writeHandle;
|
2010-03-02 09:51:12 +00:00
|
|
|
|
#endif
|
2011-02-16 05:49:45 +00:00
|
|
|
|
#if GS_NONFRAGILE
|
|
|
|
|
#else
|
2011-02-14 06:37:45 +00:00
|
|
|
|
/* Pointer to private additional data used to avoid breaking ABI
|
|
|
|
|
* when we don't have the non-fragile ABI available.
|
2011-02-16 05:49:45 +00:00
|
|
|
|
* Use this mechanism rather than changing the instance variable
|
|
|
|
|
* layout (see Source/GSInternal.h for details).
|
2011-02-14 06:37:45 +00:00
|
|
|
|
*/
|
2011-03-05 18:12:55 +00:00
|
|
|
|
@private id _internal GS_UNUSED_IVAR;
|
2011-02-14 06:37:45 +00:00
|
|
|
|
#endif
|
1997-09-01 21:59:51 +00:00
|
|
|
|
}
|
1999-09-16 07:21:34 +00:00
|
|
|
|
+ (id) pipe;
|
|
|
|
|
- (NSFileHandle*) fileHandleForReading;
|
|
|
|
|
- (NSFileHandle*) fileHandleForWriting;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
|
2000-11-15 14:32:18 +00:00
|
|
|
|
|
2006-10-31 07:05:46 +00:00
|
|
|
|
#if OS_API_VERSION(GS_API_NONE, GS_API_NONE)
|
2000-11-15 14:32:18 +00:00
|
|
|
|
|
1997-09-01 21:59:51 +00:00
|
|
|
|
// GNUstep class extensions
|
|
|
|
|
|
|
|
|
|
@interface NSFileHandle (GNUstepExtensions)
|
2011-02-14 10:57:57 +00:00
|
|
|
|
+ (id) fileHandleAsServerAtAddress: (NSString*)address
|
|
|
|
|
service: (NSString*)service
|
|
|
|
|
protocol: (NSString*)protocol;
|
|
|
|
|
+ (id) fileHandleAsClientAtAddress: (NSString*)address
|
|
|
|
|
service: (NSString*)service
|
|
|
|
|
protocol: (NSString*)protocol;
|
|
|
|
|
+ (id) fileHandleAsClientInBackgroundAtAddress: (NSString*)address
|
|
|
|
|
service: (NSString*)service
|
|
|
|
|
protocol: (NSString*)protocol;
|
|
|
|
|
+ (id) fileHandleAsClientInBackgroundAtAddress: (NSString*)address
|
|
|
|
|
service: (NSString*)service
|
|
|
|
|
protocol: (NSString*)protocol
|
|
|
|
|
forModes: (NSArray*)modes;
|
2002-06-23 19:53:15 +00:00
|
|
|
|
- (void) readDataInBackgroundAndNotifyLength: (unsigned)len;
|
|
|
|
|
- (void) readDataInBackgroundAndNotifyLength: (unsigned)len
|
|
|
|
|
forModes: (NSArray*)modes;
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (BOOL) readInProgress;
|
|
|
|
|
- (NSString*) socketAddress;
|
2004-08-18 10:12:13 +00:00
|
|
|
|
- (NSString*) socketLocalAddress;
|
|
|
|
|
- (NSString*) socketLocalService;
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (NSString*) socketService;
|
|
|
|
|
- (NSString*) socketProtocol;
|
2001-10-24 16:34:00 +00:00
|
|
|
|
- (BOOL) useCompression;
|
1999-09-16 07:21:34 +00:00
|
|
|
|
- (void) writeInBackgroundAndNotify: (NSData*)item forModes: (NSArray*)modes;
|
|
|
|
|
- (void) writeInBackgroundAndNotify: (NSData*)item;
|
|
|
|
|
- (BOOL) writeInProgress;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
@end
|
|
|
|
|
|
2004-06-22 22:27:39 +00:00
|
|
|
|
/**
|
2001-12-04 14:59:09 +00:00
|
|
|
|
* Where OpenSSL is available, you can use the subclass returned by +sslClass
|
2009-12-11 15:13:16 +00:00
|
|
|
|
* to handle SSL connections.<br />
|
|
|
|
|
* The -sslAccept method is used to do SSL handshake and start an
|
|
|
|
|
* encrypted session on a channel where the connection was initiated
|
|
|
|
|
* from the far end.<br />
|
|
|
|
|
* The -sslConnect method is used to do SSL handshake and start an
|
|
|
|
|
* encrypted session on a channel where the connection was initiated
|
|
|
|
|
* from the near end.<br />
|
|
|
|
|
* The -sslDisconnect method is used to end the encrypted session.
|
|
|
|
|
* The -sslSetCertificate:privateKey:PEMpasswd: method is used to
|
|
|
|
|
* establish a client certificate before starting an encrypted session.<br />
|
|
|
|
|
* NB. Some of these methods may block while performing I/O on the network
|
|
|
|
|
* connection, (though they should run the current runloop while doing so)
|
|
|
|
|
* so you should structure your code to handle that. In particular, if you
|
|
|
|
|
* are writing a server application, you should initiate a background accept
|
|
|
|
|
* to allow another incoming connection <em>before</em> you perform an
|
|
|
|
|
* -sslAccept on a connection you have just accepted.
|
2000-11-15 14:32:18 +00:00
|
|
|
|
*/
|
2012-09-23 12:26:28 +00:00
|
|
|
|
@interface NSFileHandle (GNUstepTLS)
|
|
|
|
|
|
|
|
|
|
/** Returns the class to handle ssl enabled connections.
|
|
|
|
|
*/
|
2001-12-04 14:59:09 +00:00
|
|
|
|
+ (Class) sslClass;
|
2012-09-23 12:26:28 +00:00
|
|
|
|
|
|
|
|
|
/** Repeatedly attempt an incoming handshake for up to 30 seconds or until
|
|
|
|
|
* the handshake completes.
|
|
|
|
|
*/
|
2003-11-05 18:26:09 +00:00
|
|
|
|
- (BOOL) sslAccept;
|
2012-09-23 12:26:28 +00:00
|
|
|
|
|
|
|
|
|
/** Repeatedly attempt an outgoing handshake for up to 30 seconds or until
|
|
|
|
|
* the handshake completes.
|
|
|
|
|
*/
|
2000-11-15 14:41:15 +00:00
|
|
|
|
- (BOOL) sslConnect;
|
2012-09-23 12:26:28 +00:00
|
|
|
|
|
|
|
|
|
/** <override-dummy />
|
|
|
|
|
* Shuts down the SSL connection to the system that the handle is talking to.
|
|
|
|
|
*/
|
2000-11-15 14:32:18 +00:00
|
|
|
|
- (void) sslDisconnect;
|
2012-09-23 12:26:28 +00:00
|
|
|
|
|
|
|
|
|
/** <override-dummy />
|
|
|
|
|
* Make a non-blocking handshake attempt. Calls to this method should be
|
2011-07-12 11:40:15 +00:00
|
|
|
|
* repeated until the method returns YES indicating that the handshake
|
|
|
|
|
* completed. If the method returns YES indicating completion of the
|
|
|
|
|
* handshake, the result indicates whether the handshake succeeded in
|
2012-09-23 12:26:28 +00:00
|
|
|
|
* establishing a connection or not.<br />
|
|
|
|
|
* The default implementation simply returns YES and sets result to NO.<br />
|
|
|
|
|
* This is implemented by an SSL handling subclass to perform real work.
|
2011-07-12 11:40:15 +00:00
|
|
|
|
*/
|
|
|
|
|
- (BOOL) sslHandshakeEstablished: (BOOL*)result outgoing: (BOOL)isOutgoing;
|
2012-09-23 12:26:28 +00:00
|
|
|
|
|
2017-05-19 11:38:48 +00:00
|
|
|
|
/** If the session verified a certificate from the remote end, returns the
|
|
|
|
|
* name of the certificate issuer in the form "C=xxxx,O=yyyy,CN=zzzz" as
|
|
|
|
|
* described in RFC2253. Otherwise returns nil.
|
|
|
|
|
*/
|
|
|
|
|
- (NSString*) sslIssuer;
|
|
|
|
|
|
|
|
|
|
/** If the session verified a certificate from the remote end, returns the
|
|
|
|
|
* name of the certificate owner in the form "C=xxxx,O=yyyy,CN=zzzz" as
|
|
|
|
|
* described in RFC2253. Otherwise returns nil.
|
|
|
|
|
*/
|
|
|
|
|
- (NSString*) sslOwner;
|
|
|
|
|
|
2012-09-23 12:26:28 +00:00
|
|
|
|
/** Deprecated ... use -sslSetOptions: instead
|
2011-07-12 11:40:15 +00:00
|
|
|
|
*/
|
2000-11-15 14:32:18 +00:00
|
|
|
|
- (void) sslSetCertificate: (NSString*)certFile
|
|
|
|
|
privateKey: (NSString*)privateKey
|
|
|
|
|
PEMpasswd: (NSString*)PEMpasswd;
|
2012-09-23 12:26:28 +00:00
|
|
|
|
|
|
|
|
|
/** <override-dummy />
|
|
|
|
|
* Sets options to be used to configure this channel before the handshake.<br />
|
|
|
|
|
* Returns nil on success, or an error message if some options could not
|
2012-09-28 16:08:19 +00:00
|
|
|
|
* be set.<br />
|
2013-09-18 12:49:07 +00:00
|
|
|
|
* You may use the same options as property settings with the GNUstep
|
|
|
|
|
* implementation of NSStream.<br />
|
|
|
|
|
* Expects key value pairs with the follwing names/meanings:
|
2012-09-23 12:26:28 +00:00
|
|
|
|
* <deflist>
|
2012-09-28 16:08:19 +00:00
|
|
|
|
* <term>GSTLSCAFile</term>
|
|
|
|
|
* <desc>A string identifying the full path to the file containing any
|
|
|
|
|
* trusted certificate authorities to be used when verifying a certificate
|
|
|
|
|
* presented by the remote end of a connection.
|
|
|
|
|
* </desc>
|
2012-09-24 09:07:55 +00:00
|
|
|
|
* <term>GSTLSCertificateFile</term>
|
2012-09-23 12:26:28 +00:00
|
|
|
|
* <desc>The path to a PEM encoded certificate used to identify this end
|
|
|
|
|
* of the connection. This option <em>must</em> be set for handing an
|
|
|
|
|
* incoming connection, but is optional for outgoing connections.<br />
|
2012-09-26 15:23:24 +00:00
|
|
|
|
* This must be used in conjunction with GSTLSCertificateKeyFile.
|
2012-09-28 16:08:19 +00:00
|
|
|
|
* </desc>
|
2012-09-26 15:23:24 +00:00
|
|
|
|
* <term>GSTLSCertificateKeyFile</term>
|
2012-09-23 12:26:28 +00:00
|
|
|
|
* <desc>The path to a PEM encoded key used to unlock the certificate
|
|
|
|
|
* file for the connection. The key in the file may or may not be
|
|
|
|
|
* encrypted, but if it is encrypted you must specify
|
2012-09-26 15:23:24 +00:00
|
|
|
|
* GSTLSCertificateKeyPassword.
|
2012-09-28 16:08:19 +00:00
|
|
|
|
* </desc>
|
2012-09-26 15:23:24 +00:00
|
|
|
|
* <term>GSTLSCertificateKeyPassword</term>
|
2012-09-23 12:26:28 +00:00
|
|
|
|
* <desc>A string to be used as the password to decrypt a key which was
|
|
|
|
|
* specified using GSTLSKeyPassword.
|
2012-09-28 16:08:19 +00:00
|
|
|
|
* </desc>
|
|
|
|
|
* <term>GSTLSDebug</term>
|
|
|
|
|
* <desc>A boolean specifying whether diagnostic debug is to be enabled
|
|
|
|
|
* to log information about a connection where the handshake fails.<br />
|
|
|
|
|
* </desc>
|
|
|
|
|
* <term>GSTLSPriority</term>
|
|
|
|
|
* <desc>A GNUTLS priority string describing the ciphers etc which may be
|
|
|
|
|
* used for the connection. In addition the string may be one of
|
2012-09-30 10:14:00 +00:00
|
|
|
|
* SSLv3, or TLSv1 to use the appropriate general settings
|
2012-09-28 16:08:19 +00:00
|
|
|
|
* for negotiating a connection of the specified type.
|
|
|
|
|
* </desc>
|
|
|
|
|
* <term>GSTLSRemoteHosts</term>
|
|
|
|
|
* <desc>A comma delimited list of host names to be allowed when verifying
|
|
|
|
|
* the certificate of the host we are connecting to.<br />
|
|
|
|
|
* If this is not specified, all the names provided by NSHost are used.
|
|
|
|
|
* </desc>
|
|
|
|
|
* <term>GSTLSRevokeFile</term>
|
|
|
|
|
* <desc>The full path of a file containing certificate revocation
|
|
|
|
|
* information for certificates issued by our trusted authorites but
|
|
|
|
|
* no longer valid.
|
|
|
|
|
* </desc>
|
|
|
|
|
* <term>GSTLSVerify</term>
|
|
|
|
|
* <desc>A boolean specifying whether we should require the remote end to
|
|
|
|
|
* supply a valid certificate in order to establish an encrypted connection.
|
|
|
|
|
* </desc>
|
2012-09-23 12:26:28 +00:00
|
|
|
|
* </deflist>
|
|
|
|
|
*/
|
|
|
|
|
- (NSString*) sslSetOptions: (NSDictionary*)options;
|
|
|
|
|
|
2013-09-18 12:49:07 +00:00
|
|
|
|
/** Sets the known (cached) data content for the specified file name.<br />
|
|
|
|
|
* Calling this with a nil data object will remove any existing value
|
|
|
|
|
* from the cache.<br />
|
|
|
|
|
* You may use this method to control what data is used for specified
|
|
|
|
|
* file names when those file names are used as a result of SSL/TLS
|
|
|
|
|
* options being set for a file handle or stream.
|
|
|
|
|
*/
|
|
|
|
|
+ (void) setData: (NSData*)data forTLSFile: (NSString*)fileName;
|
|
|
|
|
|
2000-11-15 14:32:18 +00:00
|
|
|
|
@end
|
|
|
|
|
|
2013-09-18 12:49:07 +00:00
|
|
|
|
/** Dictionary key for the path to a PEM encoded certificate authority
|
|
|
|
|
* file.
|
|
|
|
|
*/
|
|
|
|
|
GS_EXPORT NSString * const GSTLSCAFile;
|
|
|
|
|
|
2012-09-23 12:26:28 +00:00
|
|
|
|
/** Dictionary key for the path to a PEM encoded certificate used
|
|
|
|
|
* to identify this end of a connection.
|
|
|
|
|
*/
|
2012-09-24 09:07:55 +00:00
|
|
|
|
GS_EXPORT NSString * const GSTLSCertificateFile;
|
2012-09-23 12:26:28 +00:00
|
|
|
|
|
|
|
|
|
/** Dictionary key for the path to a PEM encoded private key used
|
|
|
|
|
* to unlock the certificate used by this end of a connection.
|
|
|
|
|
*/
|
2012-09-26 15:23:24 +00:00
|
|
|
|
GS_EXPORT NSString * const GSTLSCertificateKeyFile;
|
2012-09-23 12:26:28 +00:00
|
|
|
|
|
|
|
|
|
/** Dictionary key for the password used to decrypt the key file used
|
|
|
|
|
* to unlock the certificate used by this end of a connection.
|
|
|
|
|
*/
|
2012-09-26 15:23:24 +00:00
|
|
|
|
GS_EXPORT NSString * const GSTLSCertificateKeyPassword;
|
2012-09-23 12:26:28 +00:00
|
|
|
|
|
2013-09-18 12:49:07 +00:00
|
|
|
|
/** Dictionary key for a boolean to enable TLS debug for a session.
|
|
|
|
|
*/
|
|
|
|
|
GS_EXPORT NSString * const GSTLSDebug;
|
|
|
|
|
|
|
|
|
|
/** Dictionary key for a GNUTLS priority setting for a session.
|
|
|
|
|
*/
|
|
|
|
|
GS_EXPORT NSString * const GSTLSPriority;
|
|
|
|
|
|
|
|
|
|
/** Dictionary key for a list of hosts to use in certificate verification.
|
|
|
|
|
*/
|
|
|
|
|
GS_EXPORT NSString * const GSTLSRemoteHosts;
|
|
|
|
|
|
|
|
|
|
/** Dictionary key for the path to a PEM encoded certificate revocation
|
|
|
|
|
* file.
|
|
|
|
|
*/
|
|
|
|
|
GS_EXPORT NSString * const GSTLSRevokeFile;
|
|
|
|
|
|
|
|
|
|
/** Dictionary key for a boolean to enable certificate verification.
|
|
|
|
|
*/
|
|
|
|
|
GS_EXPORT NSString * const GSTLSVerify;
|
|
|
|
|
|
1997-09-01 21:59:51 +00:00
|
|
|
|
// GNUstep Notification names.
|
|
|
|
|
|
2004-07-29 15:30:47 +00:00
|
|
|
|
/**
|
|
|
|
|
* Notification posted when an asynchronous [NSFileHandle] connection
|
|
|
|
|
* attempt (to an FTP, HTTP, or other internet server) has succeeded.
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const GSFileHandleConnectCompletionNotification;
|
2004-07-29 15:30:47 +00:00
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Notification posted when an asynchronous [NSFileHandle] write
|
|
|
|
|
* operation (to an FTP, HTTP, or other internet server) has succeeded.
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const GSFileHandleWriteCompletionNotification;
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
2004-07-29 15:30:47 +00:00
|
|
|
|
/**
|
|
|
|
|
* Message describing error in asynchronous [NSFileHandle] accept,read,write
|
|
|
|
|
* operation.
|
|
|
|
|
*/
|
2002-06-06 14:02:59 +00:00
|
|
|
|
GS_EXPORT NSString * const GSFileHandleNotificationError;
|
2013-09-18 12:49:07 +00:00
|
|
|
|
|
2000-11-15 14:32:18 +00:00
|
|
|
|
#endif
|
1997-09-01 21:59:51 +00:00
|
|
|
|
|
2006-09-13 10:20:49 +00:00
|
|
|
|
#if defined(__cplusplus)
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
2010-02-20 17:16:23 +00:00
|
|
|
|
#if !NO_GNUSTEP && !defined(GNUSTEP_BASE_INTERNAL)
|
2010-02-18 11:40:58 +00:00
|
|
|
|
#import <GNUstepBase/NSFileHandle+GNUstepBase.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
1997-09-01 21:59:51 +00:00
|
|
|
|
#endif /* __NSFileHandle_h_GNUSTEP_BASE_INCLUDE */
|