ArcGIS Runtime SDK for iOS: AGSCredential.h Source File
ArcGIS Runtime SDK for iOS  100.9
AGSCredential.h
Go to the documentation of this file.
1 /*
2  COPYRIGHT 1995-2020 ESRI
3 
4  TRADE SECRETS: ESRI PROPRIETARY AND CONFIDENTIAL
5  Unpublished material - all rights reserved under the
6  Copyright Laws of the United States and applicable international
7  laws, treaties, and conventions.
8 
9  For additional information, contact:
10  Environmental Systems Research Institute, Inc.
11  Attn: Contracts and Legal Services Department
12  380 New York Street
13  Redlands, California, 92373
14  USA
15 
16  email: contracts@esri.com
17  */
18  //Required for Globals API doc
20 
21 #import <Foundation/Foundation.h>
22 #import <Security/Security.h>
23 
24 
25 
31 typedef {
32  AGSCredentialErrorTypeNone = 0,
33  AGSCredentialErrorTypeInvalidCredentials ,
34  AGSCredentialErrorTypeSSLRequired ,
35  AGSCredentialErrorTypeUnknown
36 };
37 
46 @interface AGSCredential : NSObject <NSCopying, NSCoding>
47 
48 #pragma mark -
49 #pragma mark properties
50 
54 @property (nullable, nonatomic, copy) NSString *username;
55 
59 @property (nullable, nonatomic, copy) NSString *password;
60 
64 @property (nullable, nonatomic, strong) NSURL *tokenUrl;
65 
69 @property (nullable, nonatomic, copy, readonly) NSString *referer;
70 
71 
75 @property (nullable, nonatomic, copy) NSString *token;
76 
80 @property (nullable, nonatomic, assign) SecIdentityRef identity;
81 
85 @property (nonatomic, assign, readwrite, getter=isCachingEnabled) BOOL cachingEnabled;
86 
90 @property (nullable, nonatomic, copy) NSData *identityCertificateData;
91 
95 @property (nullable, nonatomic, copy) NSString *identityCertificatePassword;
96 
97 #pragma mark -
98 #pragma mark initializers
99 
106 - (instancetype)initWithUser:(NSString*)username password:(NSString*)password;
107 
113 - (instancetype)initWithIdentityRef:(SecIdentityRef)identityRef;
114 
121 - (instancetype)initWithToken:(NSString*)token referer:(nullable NSString*)referer;
122 
129 - (nullable instancetype)initWithIdentityCertificateData:(NSData *)data password:(NSString *)password;
130 
137 + (instancetype)credentialWithUser:(NSString*)username password:(NSString*)password;
138 
139 #pragma mark -
140 #pragma mark methods
141 
154 + (nullable NSArray<id>*)identitiesForProtectionSpace:(nullable NSURLProtectionSpace*)protectionSpace ;
155 
171 + (nullable SecIdentityRef)importCertificateData:(NSData*)data password:(NSString*)password overwrite:(BOOL)overwrite error:(NSError**)error ;
172 
183 + (OSStatus)removeIdentityFromKeychain:(SecIdentityRef)identityRef ;
184 
189 - (nullable NSString*)authenticatingHost;
190 
191 @end
192 
193 
nullable NSString * authenticatingHost()
NSString * username
Definition: AGSCredential.h:54
NSString * token
Definition: AGSCredential.h:75
BOOL cachingEnabled
Definition: AGSCredential.h:85
NSString * password
Definition: AGSCredential.h:59
SecIdentityRef identity
Definition: AGSCredential.h:80
Represents an credential to access a secured resource.
Definition: AGSCredential.h:46
NSURL * tokenUrl
Definition: AGSCredential.h:64
NSString * identityCertificatePassword
Definition: AGSCredential.h:95
NSData * identityCertificateData
Definition: AGSCredential.h:90
NSString * referer
Definition: AGSCredential.h:69