[NET 6 Attribute Conversion] Security (#14033)

* Removing attributes for mellite

* Remove existing attributes

* Attribute Conversion

* Reverting changes to Security/Enums.cs and Security/SecureTransport.cs since they are API source

* Revert "Removing attributes for mellite"

This reverts commit eea2898870.

* Fixing Verifies, Moving Obsolete, Adding missing conversion

* Adding in removed comments and messages

* Removing unused NET Attributes

* Removing duplicated comments

* Removing not needed availability

* Remove todos

* removing other not needed availability

Co-authored-by: tj_devel709 <antlambe@microsoft.com>
Co-authored-by: TJ Lambert <tjlambert@microsoft.com>
This commit is contained in:
TJ Lambert 2022-02-14 10:36:33 -06:00 коммит произвёл GitHub
Родитель d9a02066ce
Коммит 764e797ceb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
18 изменённых файлов: 1756 добавлений и 938 удалений

Просмотреть файл

@ -140,13 +140,14 @@ namespace Security {
[DllImport (Constants.SecurityLibrary)]
extern static int /* OSStatus = int */ AuthorizationCreate (AuthorizationItemSet *rights, AuthorizationItemSet *environment, AuthorizationFlags flags, out IntPtr auth);
#if !NET
[Deprecated (PlatformName.MacOSX, 10,7)]
#else
#if NET
[SupportedOSPlatform ("maccatalyst15.0")]
[UnsupportedOSPlatform ("macos10.7")]
#if MONOMAC
[Obsolete ("Starting with macos10.7 use the Service Management framework or the launchd-launched helper tool instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,7)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static int /* OSStatus = int */ AuthorizationExecuteWithPrivileges (IntPtr handle, string pathToTool, AuthorizationFlags flags, string? []? args, IntPtr FILEPtr);
@ -160,13 +161,14 @@ namespace Security {
{
}
#if !NET
[Deprecated (PlatformName.MacOSX, 10,7)]
#else
#if NET
[SupportedOSPlatform ("maccatalyst15.0")]
[UnsupportedOSPlatform ("macos10.7")]
#if MONOMAC
[Obsolete ("Starting with macos10.7 use the Service Management framework or the launchd-launched helper tool instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,7)]
#endif
public int ExecuteWithPrivileges (string pathToTool, AuthorizationFlags flags, string []? args)
{

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -63,32 +63,32 @@ namespace Security {
Invalid = -1,
WhenUnlocked,
AfterFirstUnlock,
#if !NET
#if NET
[UnsupportedOSPlatform ("macos10.14")]
[UnsupportedOSPlatform ("ios12.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.14 use 'AfterFirstUnlock' or a better suited option instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios12.0 use 'AfterFirstUnlock' or a better suited option instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'AfterFirstUnlock' or a better suited option instead.")]
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'AfterFirstUnlock' or a better suited option instead.")]
#else
[UnsupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.14")]
#if IOS
[Obsolete ("Starting with ios12.0 use 'AfterFirstUnlock' or a better suited option instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.14 use 'AfterFirstUnlock' or a better suited option instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
Always,
WhenUnlockedThisDeviceOnly,
AfterFirstUnlockThisDeviceOnly,
#if !NET
#if NET
[UnsupportedOSPlatform ("macos10.14")]
[UnsupportedOSPlatform ("ios12.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.14 use 'AfterFirstUnlockThisDeviceOnly' or a better suited option instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios12.0 use 'AfterFirstUnlockThisDeviceOnly' or a better suited option instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,14, message: "Use 'AfterFirstUnlockThisDeviceOnly' or a better suited option instead.")]
[Deprecated (PlatformName.iOS, 12,0, message: "Use 'AfterFirstUnlockThisDeviceOnly' or a better suited option instead.")]
#else
[UnsupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.14")]
#if IOS
[Obsolete ("Starting with ios12.0 use 'AfterFirstUnlock' or a better suited option instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.14 use 'AfterFirstUnlock' or a better suited option instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
AlwaysThisDeviceOnly,
WhenPasscodeSetThisDeviceOnly
@ -823,7 +823,9 @@ namespace Security {
}
#if !MONOMAC
#if !NET
#if NET
[SupportedOSPlatform ("ios9.0")]
#else
[iOS (9,0)]
#endif
public string? SyncViewHint {
@ -835,7 +837,9 @@ namespace Security {
}
}
#if !NET
#if NET
[SupportedOSPlatform ("ios9.0")]
#else
[iOS (9,0)]
#endif
public SecTokenID TokenID {
@ -973,16 +977,15 @@ namespace Security {
}
}
#if !NET
[iOS (8, 0)]
#endif
#if !NET
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'AuthenticationUI' property instead.")]
#else
#if NET
[SupportedOSPlatform ("ios8.0")]
[UnsupportedOSPlatform ("ios9.0")]
#if IOS
[Obsolete ("Starting with ios9.0 use 'AuthenticationUI' property instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (8, 0)]
[Deprecated (PlatformName.iOS, 9, 0, message : "Use 'AuthenticationUI' property instead.")]
#endif
public bool UseNoAuthenticationUI {
get {
@ -993,8 +996,12 @@ namespace Security {
}
}
#endif
#if !NET
[iOS (9,0)][Mac (10,11)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.11")]
#else
[iOS (9,0)]
[Mac (10,11)]
#endif
public SecAuthenticationUI AuthenticationUI {
get {
@ -1007,8 +1014,12 @@ namespace Security {
}
#if !WATCH && !TVOS
#if !NET
[iOS (9, 0), Mac (10, 11)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.11")]
#else
[iOS (9, 0)]
[Mac (10, 11)]
#endif
public LocalAuthentication.LAContext? AuthenticationContext {
get {
@ -1347,11 +1358,15 @@ namespace Security {
}
}
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)][Mac (10,13)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13")]
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13)]
#endif
public bool PersistentReference {
get {
@ -1754,8 +1769,12 @@ namespace Security {
// For caching, as we can't reverse it easily.
SecAccessControl? _secAccessControl;
#if !NET
[iOS (8, 0), Mac (10, 10)]
#if NET
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("macos10.10")]
#else
[iOS (8, 0)]
[Mac (10, 10)]
#endif
public SecAccessControl AccessControl {
get {
@ -1790,8 +1809,12 @@ namespace Security {
// For caching, as we can't reverse it easily.
SecAccessControl? _secAccessControl;
#if !NET
[iOS (8, 0), Mac (10, 10)]
#if NET
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("macos10.10")]
#else
[iOS (8, 0)]
[Mac (10, 10)]
#endif
public SecAccessControl AccessControl {
get {
@ -1806,8 +1829,12 @@ namespace Security {
}
}
#if !NET
[iOS (9, 0), Mac (10, 12)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12")]
#else
[iOS (9, 0)]
[Mac (10, 12)]
#endif
public SecTokenID TokenID {
get {

Просмотреть файл

@ -38,61 +38,102 @@ namespace Security {
#endif
UserPresence = 1 << 0,
[Advice ("'BiometryAny' is preferred over 'TouchIDAny' since Xcode 9.3. Touch ID and Face ID together are biometric authentication mechanisms.")]
#if !NET
[iOS (9,0)][Mac (10,12,1)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12.1")]
#else
[iOS (9,0)]
[Mac (10,12,1)]
#endif
[Advice ("'BiometryAny' is preferred over 'TouchIDAny' since Xcode 9.3. Touch ID and Face ID together are biometric authentication mechanisms.")]
TouchIDAny = BiometryAny,
[Advice ("'BiometryCurrentSet' is preferred over 'TouchIDCurrentSet' since Xcode 9.3. Touch ID and Face ID together are biometric authentication mechanisms.")]
#if !NET
[iOS (9,0)][Mac (10,12,1)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12.1")]
#else
[iOS (9,0)]
[Mac (10,12,1)]
#endif
[Advice ("'BiometryCurrentSet' is preferred over 'TouchIDCurrentSet' since Xcode 9.3. Touch ID and Face ID together are biometric authentication mechanisms.")]
TouchIDCurrentSet = BiometryCurrentSet,
// Added in iOS 11.3 and macOS 10.13.4 but keeping initial availability attribute because it's using the value
// of 'TouchIDAny' which iOS 9 / macOS 10.12.1 will accept.
#if !NET
[iOS (9,0), Mac (10,12,1)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12.1")]
#else
[iOS (9,0)]
[Mac (10,12,1)]
#endif
BiometryAny = 1 << 1,
// Added in iOS 11.3 and macOS 10.13.4 but keeping initial availability attribute because it's using the value
// of 'TouchIDCurrentSet' which iOS 9 / macOS 10.12.1 will accept.
#if !NET
[iOS (9,0), Mac (10,12,1)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12.1")]
#else
[iOS (9,0)]
[Mac (10,12,1)]
#endif
BiometryCurrentSet = 1 << 3,
#if !NET
[iOS (9,0)][Mac (10,11)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.11")]
#else
[iOS (9,0)]
[Mac (10,11)]
#endif
DevicePasscode = 1 << 4,
#if !NET
[Mac (10,15)][NoiOS][NoTV][NoWatch]
#else
#if NET
[SupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("tvos")]
#else
[Mac (10,15)]
[NoiOS]
[NoTV]
[NoWatch]
#endif
Watch = 1 << 5,
#if !NET
[iOS (9,0)][Mac (10,12,1)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12.1")]
#else
[iOS (9,0)]
[Mac (10,12,1)]
#endif
Or = 1 << 14,
#if !NET
[iOS (9,0)][Mac (10,12,1)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12.1")]
#else
[iOS (9,0)]
[Mac (10,12,1)]
#endif
And = 1 << 15,
#if !NET
[iOS (9,0)][Mac (10,12,1)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12.1")]
#else
[iOS (9,0)]
[Mac (10,12,1)]
#endif
PrivateKeyUsage = 1 << 30,
#if !NET
[iOS (9,0)][Mac (10,12,1)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.12.1")]
#else
[iOS (9,0)]
[Mac (10,12,1)]
#endif
#if NET
ApplicationPassword = 1UL << 31,
@ -101,8 +142,12 @@ namespace Security {
#endif
}
#if !NET
[Mac (10,10)][iOS (8,0)]
#if NET
[SupportedOSPlatform ("macos10.10")]
[SupportedOSPlatform ("ios8.0")]
#else
[Mac (10,10)]
[iOS (8,0)]
#endif
public partial class SecAccessControl : NativeObject {
#if !COREBUILD

Просмотреть файл

@ -25,12 +25,15 @@ using NativeHandle = System.IntPtr;
namespace Security {
#if !NET
[TV (12,0), Mac (10,14), iOS (12,0), Watch (5,0)]
#else
[SupportedOSPlatform ("ios12.0")]
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (5,0)]
#endif
public class SecCertificate2 : NativeObject {
[Preserve (Conditional = true)]

Просмотреть файл

@ -25,12 +25,15 @@ using NativeHandle = System.IntPtr;
namespace Security {
#if !NET
[TV (12,0), Mac (10,14), iOS (12,0), Watch (5,0)]
#else
[SupportedOSPlatform ("ios12.0")]
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (5,0)]
#endif
public class SecIdentity2 : NativeObject {
#if NET
@ -87,12 +90,15 @@ namespace Security {
}
}
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
@ -109,12 +115,15 @@ namespace Security {
del (new SecCertificate2 (cert, false));
}
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
// no [Async] as it can be called multiple times
[BindingImpl (BindingImplOptions.Optimizable)]

Просмотреть файл

@ -18,13 +18,17 @@ namespace Security {
public partial class SecPolicy {
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static IntPtr /* __nullable CFDictionaryRef */ SecPolicyCopyProperties (IntPtr /* SecPolicyRef */ policyRef);
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
public NSDictionary GetProperties ()
@ -33,14 +37,20 @@ namespace Security {
return Runtime.GetNSObject<NSDictionary> (dict, true);
}
#if !NET
#if NET
[SupportedOSPlatform ("macos10.9")]
#else
[Mac (10,9)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static IntPtr /* __nullable SecPolicyRef */ SecPolicyCreateRevocation (/* CFOptionFlags */ nuint revocationFlags);
#if !NET
[Mac (10,9)][iOS (7,0)]
#if NET
[SupportedOSPlatform ("macos10.9")]
[SupportedOSPlatform ("ios7.0")]
#else
[Mac (10,9)]
[iOS (7,0)]
#endif
static public SecPolicy CreateRevocationPolicy (SecRevocation revocationFlags)
{
@ -48,14 +58,22 @@ namespace Security {
return policy == IntPtr.Zero ? null : new SecPolicy (policy, true);
}
#if !NET
[Mac (10,9)][iOS (7,0)]
#if NET
[SupportedOSPlatform ("macos10.9")]
[SupportedOSPlatform ("ios7.0")]
#else
[Mac (10,9)]
[iOS (7,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static IntPtr /* __nullable SecPolicyRef */ SecPolicyCreateWithProperties (IntPtr /* CFTypeRef */ policyIdentifier, IntPtr /* CFDictionaryRef */ properties);
#if !NET
[Mac (10,9)][iOS (7,0)]
#if NET
[SupportedOSPlatform ("macos10.9")]
[SupportedOSPlatform ("ios7.0")]
#else
[Mac (10,9)]
[iOS (7,0)]
#endif
static public SecPolicy CreatePolicy (NSString policyIdentifier, NSDictionary properties)
{

Просмотреть файл

@ -22,12 +22,15 @@ using NativeHandle = System.IntPtr;
#endif
namespace Security {
#if !NET
[TV (12,0), Mac (10,14), iOS (12,0), Watch (5,0)]
#else
[SupportedOSPlatform ("ios12.0")]
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (5,0)]
#endif
public class SecProtocolMetadata : NativeObject {
#if !NET
@ -50,80 +53,98 @@ namespace Security {
public DispatchData PeerPublicKey => CreateDispatchData (sec_protocol_metadata_copy_peer_public_key (GetCheckedHandle ()));
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'NegotiatedTlsProtocolVersion' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'NegotiatedTlsProtocolVersion' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'NegotiatedTlsProtocolVersion' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'NegotiatedTlsProtocolVersion' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'NegotiatedTlsProtocolVersion' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'NegotiatedTlsProtocolVersion' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[DllImport (Constants.SecurityLibrary)]
extern static SslProtocol sec_protocol_metadata_get_negotiated_protocol_version (IntPtr handle);
#if !NET
[Deprecated(PlatformName.MacOSX, 10, 15, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
[Deprecated(PlatformName.iOS, 13, 0, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
[Deprecated(PlatformName.WatchOS, 6, 0, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
[Deprecated(PlatformName.TvOS, 13, 0, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'NegotiatedTlsProtocolVersion' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'NegotiatedTlsProtocolVersion' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'NegotiatedTlsProtocolVersion' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'NegotiatedTlsProtocolVersion' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'NegotiatedTlsProtocolVersion' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10, 15, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
[Deprecated (PlatformName.iOS, 13, 0, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
[Deprecated (PlatformName.WatchOS, 6, 0, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
[Deprecated (PlatformName.TvOS, 13, 0, message: "Use 'NegotiatedTlsProtocolVersion' instead.")]
#endif
public SslProtocol NegotiatedProtocolVersion => sec_protocol_metadata_get_negotiated_protocol_version (GetCheckedHandle ());
#if !NET
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern TlsProtocolVersion sec_protocol_metadata_get_negotiated_tls_protocol_version (IntPtr handle);
#if !NET
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
#endif
public TlsProtocolVersion NegotiatedTlsProtocolVersion => sec_protocol_metadata_get_negotiated_tls_protocol_version (GetCheckedHandle ());
#if !NET
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern TlsCipherSuite sec_protocol_metadata_get_negotiated_tls_ciphersuite (IntPtr handle);
#if !NET
[TV (13,0), Mac (10,15), iOS (13,0), Watch (6,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
[Watch (6,0)]
#endif
public TlsCipherSuite NegotiatedTlsCipherSuite => sec_protocol_metadata_get_negotiated_tls_ciphersuite (GetCheckedHandle ());
@ -344,31 +365,40 @@ namespace Security {
return handle == IntPtr.Zero ? null : new DispatchData (handle, owns: true);
}
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* const char* */ IntPtr sec_protocol_metadata_get_server_name (IntPtr /* sec_protocol_metadata_t */ handle);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
public string ServerName => Marshal.PtrToStringAnsi (sec_protocol_metadata_get_server_name (GetCheckedHandle ()));
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
[return: MarshalAs (UnmanagedType.U1)]
@ -387,12 +417,15 @@ namespace Security {
del (CreateDispatchData (psk), CreateDispatchData (psk_identity));
}
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
// no [Async] as it can be called multiple times
[BindingImpl (BindingImplOptions.Optimizable)]

Просмотреть файл

@ -24,12 +24,15 @@ using NativeHandle = System.IntPtr;
namespace Security {
#if !NET
[TV (12,0), Mac (10,14), iOS (12,0), Watch (5,0)]
#else
[SupportedOSPlatform ("ios12.0")]
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (5,0)]
#endif
public class SecProtocolOptions : NativeObject {
#if !COREBUILD
@ -49,294 +52,393 @@ namespace Security {
}
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'AddTlsCipherSuite (TlsCipherSuite)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'AddTlsCipherSuite (TlsCipherSuite)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'AddTlsCipherSuite (TlsCipherSuite)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'AddTlsCipherSuite (TlsCipherSuite)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'AddTlsCipherSuite (TlsCipherSuite)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'AddTlsCipherSuite (TlsCipherSuite)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'AddTlsCipherSuite (TlsCipherSuite)' instead.")]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_add_tls_ciphersuite (sec_protocol_options_t handle, SslCipherSuite cipherSuite);
#endif
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'AddTlsCipherSuite (TlsCipherSuite)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'AddTlsCipherSuite (TlsCipherSuite)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'AddTlsCipherSuite (TlsCipherSuite)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
[UnsupportedOSPlatform ("maccatalyst")]
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'AddTlsCipherSuite (TlsCipherSuite)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'AddTlsCipherSuite (TlsCipherSuite)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'AddTlsCipherSuite (TlsCipherSuite)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'AddTlsCipherSuite (TlsCipherSuite)' instead.")]
[Unavailable (PlatformName.MacCatalyst)]
#endif
public void AddTlsCipherSuite (SslCipherSuite cipherSuite) => sec_protocol_options_add_tls_ciphersuite (GetCheckedHandle (), cipherSuite);
#endif
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_append_tls_ciphersuite (sec_protocol_options_t options, TlsCipherSuite ciphersuite);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
public void AddTlsCipherSuite (TlsCipherSuite cipherSuite) => sec_protocol_options_append_tls_ciphersuite (GetCheckedHandle (), cipherSuite);
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_add_tls_ciphersuite_group (sec_protocol_options_t handle, SslCipherSuiteGroup cipherSuiteGroup);
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'AddTlsCipherSuiteGroup (TlsCipherSuiteGroup)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public void AddTlsCipherSuiteGroup (SslCipherSuiteGroup cipherSuiteGroup) => sec_protocol_options_add_tls_ciphersuite_group (GetCheckedHandle (), cipherSuiteGroup);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_append_tls_ciphersuite_group (sec_protocol_options_t options, TlsCipherSuiteGroup group);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
public void AddTlsCipherSuiteGroup (TlsCipherSuiteGroup cipherSuiteGroup) => sec_protocol_options_append_tls_ciphersuite_group (GetCheckedHandle (), cipherSuiteGroup);
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'SetTlsMinVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'SetTlsMinVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'SetTlsMinVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'SetTlsMinVersion (TlsProtocolVersion)' instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_set_tls_min_version (sec_protocol_options_t handle, SslProtocol protocol);
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
[UnsupportedOSPlatform ("maccatalyst")]
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'SetTlsMinVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'SetTlsMinVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'SetTlsMinVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'SetTlsMinVersion (TlsProtocolVersion)' instead.")]
[Unavailable (PlatformName.MacCatalyst)]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("maccatalyst")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'SetTlsMinVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public void SetTlsMinVersion (SslProtocol protocol) => sec_protocol_options_set_tls_min_version (GetCheckedHandle (), protocol);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_set_min_tls_protocol_version (sec_protocol_options_t handle, TlsProtocolVersion version);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
public void SetTlsMinVersion (TlsProtocolVersion protocol) => sec_protocol_options_set_min_tls_protocol_version (GetCheckedHandle (), protocol);
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_set_tls_max_version (sec_protocol_options_t handle, SslProtocol protocol);
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
[UnsupportedOSPlatform ("maccatalyst")]
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.")]
[Unavailable (PlatformName.MacCatalyst)]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("maccatalyst")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'SetTlsMaxVersion (TlsProtocolVersion)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public void SetTlsMaxVersion (SslProtocol protocol) => sec_protocol_options_set_tls_max_version (GetCheckedHandle (), protocol);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_set_max_tls_protocol_version (sec_protocol_options_t handle, TlsProtocolVersion version);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
public void SetTlsMaxVersion (TlsProtocolVersion protocol) => sec_protocol_options_set_max_tls_protocol_version (GetCheckedHandle (), protocol);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern TlsProtocolVersion sec_protocol_options_get_default_min_dtls_protocol_version ();
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
static public TlsProtocolVersion DefaultMinDtlsProtocolVersion => sec_protocol_options_get_default_min_dtls_protocol_version ();
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern TlsProtocolVersion sec_protocol_options_get_default_max_dtls_protocol_version ();
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
static public TlsProtocolVersion DefaultMaxDtlsProtocolVersion => sec_protocol_options_get_default_max_dtls_protocol_version ();
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern TlsProtocolVersion sec_protocol_options_get_default_min_tls_protocol_version ();
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
static public TlsProtocolVersion DefaultMinTlsProtocolVersion => sec_protocol_options_get_default_min_tls_protocol_version ();
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern TlsProtocolVersion sec_protocol_options_get_default_max_tls_protocol_version ();
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
static public TlsProtocolVersion DefaultMaxTlsProtocolVersion => sec_protocol_options_get_default_max_tls_protocol_version ();
@ -360,42 +462,48 @@ namespace Security {
sec_protocol_options_set_tls_server_name (GetCheckedHandle (), serverName);
}
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use non-DHE cipher suites instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use non-DHE cipher suites instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use non-DHE cipher suites instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use non-DHE cipher suites instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_set_tls_diffie_hellman_parameters (IntPtr handle, IntPtr dispatchDataParameter);
#if !NET
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use non-DHE cipher suites instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use non-DHE cipher suites instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use non-DHE cipher suites instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use non-DHE cipher suites instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use non-DHE cipher suites instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public void SetTlsDiffieHellmanParameters (DispatchData parameters)
{
@ -472,24 +580,30 @@ namespace Security {
block_handler.CleanupBlock ();
}
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
[return: MarshalAs (UnmanagedType.I1)]
static extern bool sec_protocol_options_are_equal (sec_protocol_options_t optionsA, sec_protocol_options_t optionsB);
// Equatable would be nice but would fail on earlier OS versions
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
public bool IsEqual (SecProtocolOptions other)
{
@ -498,12 +612,15 @@ namespace Security {
return sec_protocol_options_are_equal (GetCheckedHandle (), other.Handle);
}
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
static public bool IsEqual (SecProtocolOptions optionsA, SecProtocolOptions optionsB)
{
@ -514,22 +631,28 @@ namespace Security {
return sec_protocol_options_are_equal (optionsA.Handle, optionsB.Handle);
}
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern void sec_protocol_options_set_tls_pre_shared_key_identity_hint (sec_protocol_options_t options, IntPtr /* dispatch_data */ psk_identity_hint);
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
public void SetTlsPreSharedKeyIdentityHint (DispatchData pskIdentityHint)
{

Просмотреть файл

@ -64,14 +64,22 @@ namespace Security {
}
}
[DllImport (Constants.SecurityLibrary)]
#if !NET
#if NET
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("maccatalyst14.0")]
[UnsupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("ios14.0")]
#if MONOMAC
[Obsolete ("Starting with macos11.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios14.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
[UnsupportedOSPlatform ("tvos")]
#else
[Deprecated (PlatformName.iOS, 14,0)]
[Deprecated (PlatformName.MacOSX, 11,0)]
#else
[UnsupportedOSPlatform ("ios14.0")]
[UnsupportedOSPlatform ("macos11.0")]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static void SecRequestSharedWebCredential ( IntPtr /* CFStringRef */ fqdn, IntPtr /* CFStringRef */ account,
IntPtr /* void (^completionHandler)( CFArrayRef credentials, CFErrorRef error) */ completionHandler);
@ -102,17 +110,20 @@ namespace Security {
}
#endif
#if !NET
#if NET
[SupportedOSPlatform ("ios8.0")]
[SupportedOSPlatform ("maccatalyst14.0")]
[UnsupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("ios14.0")]
#if MONOMAC
[Obsolete ("Starting with macos11.0 use 'ASAuthorizationPasswordRequest' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios14.0 use 'ASAuthorizationPasswordRequest' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
[UnsupportedOSPlatform ("tvos")]
#else
[Deprecated (PlatformName.iOS, 14,0, message: "Use 'ASAuthorizationPasswordRequest' instead.")]
[Deprecated (PlatformName.MacOSX, 11,0, message: "Use 'ASAuthorizationPasswordRequest' instead.")]
#else
[UnsupportedOSPlatform ("ios14.0")]
[UnsupportedOSPlatform ("macos11.0")]
#if IOS
[Obsolete ("Starting with ios14.0 use 'ASAuthorizationPasswordRequest' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos11.0 use 'ASAuthorizationPasswordRequest' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[BindingImpl (BindingImplOptions.Optimizable)]
public static void RequestSharedWebCredential (string domainName, string account, Action<SecSharedCredentialInfo[], NSError> handler)

Просмотреть файл

@ -16,22 +16,26 @@ using System.Runtime.Versioning;
namespace Security {
public static class SecStatusCodeExtensions {
#if !NET
[iOS (11,3), TV (11,3), Watch (4,3)]
#else
#if NET
[SupportedOSPlatform ("ios11.3")]
[SupportedOSPlatform ("tvos11.3")]
#else
[iOS (11,3)]
[TV (11,3)]
[Watch (4,3)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static /* CFStringRef */ IntPtr SecCopyErrorMessageString (
/* OSStatus */ SecStatusCode status,
/* void * */ IntPtr reserved); /* always null */
#if !NET
[iOS (11,3), TV (11,3), Watch (4,3)] // Since Mac 10,3
#else
#if NET
[SupportedOSPlatform ("ios11.3")]
[SupportedOSPlatform ("tvos11.3")]
#else
[iOS (11,3)] // Since Mac 10,3
[TV (11,3)]
[Watch (4,3)]
#endif
public static string GetStatusDescription (this SecStatusCode status)
{

Просмотреть файл

@ -34,13 +34,17 @@ namespace Security {
Initialize (certificate.Handle, policy);
}
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustCopyPolicies (IntPtr /* SecTrustRef */ trust, ref IntPtr /* CFArrayRef* */ policies);
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
public SecPolicy[] GetPolicies ()
@ -88,20 +92,32 @@ namespace Security {
SetPolicies (policies.Handle);
}
#if !NET
[iOS (7,0)][Mac (10,9)]
#if NET
[SupportedOSPlatform ("ios7.0")]
[SupportedOSPlatform ("macos10.9")]
#else
[iOS (7,0)]
[Mac (10,9)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustGetNetworkFetchAllowed (IntPtr /* SecTrustRef */ trust, [MarshalAs (UnmanagedType.I1)] out bool /* Boolean* */ allowFetch);
#if !NET
[iOS (7,0)][Mac (10,9)]
#if NET
[SupportedOSPlatform ("ios7.0")]
[SupportedOSPlatform ("macos10.9")]
#else
[iOS (7,0)]
[Mac (10,9)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustSetNetworkFetchAllowed (IntPtr /* SecTrustRef */ trust, [MarshalAs (UnmanagedType.I1)] bool /* Boolean */ allowFetch);
#if !NET
[iOS (7,0)][Mac (10,9)]
#if NET
[SupportedOSPlatform ("ios7.0")]
[SupportedOSPlatform ("macos10.9")]
#else
[iOS (7,0)]
[Mac (10,9)]
#endif
public bool NetworkFetchAllowed {
get {
@ -118,13 +134,17 @@ namespace Security {
}
}
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustCopyCustomAnchorCertificates (IntPtr /* SecTrustRef */ trust, out IntPtr /* CFArrayRef* */ anchors);
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
public SecCertificate[] GetCustomAnchorCertificates ()
@ -136,25 +156,24 @@ namespace Security {
return NSArray.ArrayFromHandle<SecCertificate> (p);
}
#if !NET
[iOS (7,0)]
#if NET
[SupportedOSPlatform ("ios7.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#if !NET
#else
[iOS (7,0)]
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[DllImport (Constants.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustEvaluateAsync (IntPtr /* SecTrustRef */ trust, IntPtr /* dispatch_queue_t */ queue, ref BlockLiteral block);
@ -172,27 +191,25 @@ namespace Security {
}
}
#if !NET
[iOS (7,0)]
#if NET
[SupportedOSPlatform ("ios7.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#if !NET
#else
[iOS (7,0)]
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'Evaluate (DispatchQueue, SecTrustWithErrorCallback)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
// not always async (so suffix is removed)
[BindingImpl (BindingImplOptions.Optimizable)]
public SecStatusCode Evaluate (DispatchQueue queue, SecTrustCallback handler)
{
@ -212,12 +229,15 @@ namespace Security {
}
}
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern SecStatusCode SecTrustEvaluateAsyncWithError (IntPtr /* SecTrustRef */ trust, IntPtr /* dispatch_queue_t */ queue, ref BlockLiteral block);
@ -236,14 +256,16 @@ namespace Security {
}
}
#if !NET
[Watch (6,0), TV (13,0), Mac (10,15), iOS (13,0)]
#else
[SupportedOSPlatform ("ios13.0")]
#if NET
[SupportedOSPlatform ("tvos13.0")]
[SupportedOSPlatform ("macos10.15")]
[SupportedOSPlatform ("ios13.0")]
#else
[Watch (6,0)]
[TV (13,0)]
[Mac (10,15)]
[iOS (13,0)]
#endif
// not always async (so suffix is removed)
[BindingImpl (BindingImplOptions.Optimizable)]
public SecStatusCode Evaluate (DispatchQueue queue, SecTrustWithErrorCallback handler)
{
@ -262,13 +284,17 @@ namespace Security {
}
}
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustGetTrustResult (IntPtr /* SecTrustRef */ trust, out SecTrustResult /* SecTrustResultType */ result);
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
public SecTrustResult GetTrustResult ()
@ -280,23 +306,29 @@ namespace Security {
return trust_result;
}
#if !NET
[Watch (5,0)][TV (12,0)][Mac (10,14)][iOS (12,0)]
#else
[SupportedOSPlatform ("ios12.0")]
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
#else
[Watch (5,0)]
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
[return: MarshalAs (UnmanagedType.U1)]
static extern bool SecTrustEvaluateWithError (/* SecTrustRef */ IntPtr trust, out /* CFErrorRef** */ IntPtr error);
#if !NET
[Watch (5,0)][TV (12,0)][Mac (10,14)][iOS (12,0)]
#else
[SupportedOSPlatform ("ios12.0")]
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
#else
[Watch (5,0)]
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
#endif
public bool Evaluate (out NSError error)
{
@ -305,28 +337,42 @@ namespace Security {
return result;
}
#if !NET
[iOS (7,0)][Mac (10,9)]
#if NET
[SupportedOSPlatform ("ios7.0")]
[SupportedOSPlatform ("macos10.9")]
#else
[iOS (7,0)]
[Mac (10,9)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static IntPtr /* CFDictionaryRef */ SecTrustCopyResult (IntPtr /* SecTrustRef */ trust);
#if !NET
[iOS (7,0)][Mac (10,9)]
#if NET
[SupportedOSPlatform ("ios7.0")]
[SupportedOSPlatform ("macos10.9")]
#else
[iOS (7,0)]
[Mac (10,9)]
#endif
public NSDictionary GetResult ()
{
return new NSDictionary (SecTrustCopyResult (Handle), true);
}
#if !NET
[iOS (7,0)][Mac (10,9)]
#if NET
[SupportedOSPlatform ("ios7.0")]
[SupportedOSPlatform ("macos10.9")]
#else
[iOS (7,0)]
[Mac (10,9)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustSetOCSPResponse (IntPtr /* SecTrustRef */ trust, IntPtr /* CFTypeRef */ responseData);
// the API accept the handle for a single policy or an array of them
#if !NET
#if NET
[SupportedOSPlatform ("macos10.9")]
#else
[Mac (10,9)]
#endif
void SetOCSPResponse (IntPtr ocsp)
@ -336,7 +382,9 @@ namespace Security {
throw new InvalidOperationException (result.ToString ());
}
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
public void SetOCSPResponse (NSData ocspResponse)
@ -347,7 +395,9 @@ namespace Security {
SetOCSPResponse (ocspResponse.Handle);
}
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
public void SetOCSPResponse (IEnumerable<NSData> ocspResponses)
@ -359,7 +409,9 @@ namespace Security {
SetOCSPResponse (array.Handle);
}
#if !NET
#if NET
[SupportedOSPlatform ("ios7.0")]
#else
[iOS (7,0)]
#endif
public void SetOCSPResponse (NSArray ocspResponses)
@ -370,28 +422,28 @@ namespace Security {
SetOCSPResponse (ocspResponses.Handle);
}
#if !NET
#if NET
[SupportedOSPlatform ("ios12.1.1")]
[SupportedOSPlatform ("tvos12.1.1")]
[SupportedOSPlatform ("macos10.14.2")]
#else
[iOS (12,1,1)]
[Watch (5,1,1)]
[TV (12,1,1)]
[Mac (10,14,2)]
#else
[SupportedOSPlatform ("ios12.1.1")]
[SupportedOSPlatform ("tvos12.1.1")]
[SupportedOSPlatform ("macos10.14.2")]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern SecStatusCode /* OSStatus */ SecTrustSetSignedCertificateTimestamps (/* SecTrustRef* */ IntPtr trust, /* CFArrayRef* */ IntPtr sctArray);
#if !NET
#if NET
[SupportedOSPlatform ("ios12.1.1")]
[SupportedOSPlatform ("tvos12.1.1")]
[SupportedOSPlatform ("macos10.14.2")]
#else
[iOS (12,1,1)]
[Watch (5,1,1)]
[TV (12,1,1)]
[Mac (10,14,2)]
#else
[SupportedOSPlatform ("ios12.1.1")]
[SupportedOSPlatform ("tvos12.1.1")]
[SupportedOSPlatform ("macos10.14.2")]
#endif
public SecStatusCode SetSignedCertificateTimestamps (IEnumerable<NSData> sct)
{
@ -402,15 +454,15 @@ namespace Security {
return SecTrustSetSignedCertificateTimestamps (Handle, array.Handle);
}
#if !NET
#if NET
[SupportedOSPlatform ("ios12.1.1")]
[SupportedOSPlatform ("tvos12.1.1")]
[SupportedOSPlatform ("macos10.14.2")]
#else
[iOS (12,1,1)]
[Watch (5,1,1)]
[TV (12,1,1)]
[Mac (10,14,2)]
#else
[SupportedOSPlatform ("ios12.1.1")]
[SupportedOSPlatform ("tvos12.1.1")]
[SupportedOSPlatform ("macos10.14.2")]
#endif
public SecStatusCode SetSignedCertificateTimestamps (NSArray<NSData> sct)
{

Просмотреть файл

@ -25,12 +25,15 @@ using NativeHandle = System.IntPtr;
namespace Security {
#if !NET
[TV (12,0), Mac (10,14), iOS (12,0), Watch (5,0)]
#else
[SupportedOSPlatform ("ios12.0")]
#if NET
[SupportedOSPlatform ("tvos12.0")]
[SupportedOSPlatform ("macos10.14")]
[SupportedOSPlatform ("ios12.0")]
#else
[TV (12,0)]
[Mac (10,14)]
[iOS (12,0)]
[Watch (5,0)]
#endif
public class SecTrust2 : NativeObject {
[Preserve (Conditional = true)]

Просмотреть файл

@ -23,22 +23,22 @@ namespace Security {
unsafe delegate SslStatus SslWriteFunc (IntPtr connection, IntPtr data, /* size_t* */ nint* dataLength);
#endif
#if !NET
#if NET
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete (Constants.UseNetworkInstead, DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete (Constants.UseNetworkInstead, DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete (Constants.UseNetworkInstead, DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.iOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.TvOS, 13,0, message: Constants.UseNetworkInstead)]
[Deprecated (PlatformName.WatchOS, 6,0, message: Constants.UseNetworkInstead)]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public abstract class SslConnection : IDisposable {

Просмотреть файл

@ -26,22 +26,22 @@ using NativeHandle = System.IntPtr;
#endif
namespace Security {
#if !NET
#if NET
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 10,15, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.iOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.TvOS, 13,0, message: "Use 'Network.framework' instead.")]
[Deprecated (PlatformName.WatchOS, 6,0, message: "Use 'Network.framework' instead.")]
#else
[UnsupportedOSPlatform ("ios13.0")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("macos10.15")]
#if IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public class SslContext : NativeObject {
@ -506,32 +506,38 @@ namespace Security {
}
}
[DllImport (Constants.SecurityLibrary)]
#if !NET
#if NET
[UnsupportedOSPlatform ("macos10.11")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios9.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.11.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios9.0 the use of different RSA certificates for signing and encryption is no longer allowed.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.iOS, 9, 0, message: "The use of different RSA certificates for signing and encryption is no longer allowed.")]
[Deprecated (PlatformName.MacOSX, 10, 11)]
#else
[UnsupportedOSPlatform ("ios9.0")]
[UnsupportedOSPlatform ("macos10.11")]
#if IOS
[Obsolete ("Starting with ios9.0 the use of different RSA certificates for signing and encryption is no longer allowed.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.11 the use of different RSA certificates for signing and encryption is no longer allowed.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[DllImport (Constants.SecurityLibrary)]
extern unsafe static /* OSStatus */ SslStatus SSLSetEncryptionCertificate (/* SSLContextRef */ IntPtr context, /* CFArrayRef */ IntPtr certRefs);
#if !NET
#if NET
[UnsupportedOSPlatform ("macos10.11")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios9.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.11 export ciphers are not available anymore.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios9.0 export ciphers are not available anymore.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.iOS, 9, 0, message : "Export ciphers are not available anymore.")]
[Deprecated (PlatformName.MacOSX, 10, 11, message : "Export ciphers are not available anymore.")]
#else
[UnsupportedOSPlatform ("ios9.0")]
[UnsupportedOSPlatform ("macos10.11")]
#if IOS
[Obsolete ("Starting with ios9.0 export ciphers are not available anymore.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.11 export ciphers are not available anymore.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public SslStatus SetEncryptionCertificate (SecIdentity identify, IEnumerable<SecCertificate> certificates)
{
@ -565,17 +571,17 @@ namespace Security {
// Plus they added new members to SslSessionStrengthPolicy enum opened radar://23379052 https://trello.com/c/NbdTLVD3
// Xcode 8 beta 1: the P/Invoke was removed completely.
#if !NET
[Unavailable (PlatformName.iOS, message : "'SetSessionStrengthPolicy' is not available anymore.")]
[Unavailable (PlatformName.MacOSX, message : "'SetSessionStrengthPolicy' is not available anymore.")]
#else
#if NET
[UnsupportedOSPlatform ("tvos13.0")]
#if TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
[UnsupportedOSPlatform ("ios")]
[UnsupportedOSPlatform ("macos")]
#endif
#if !NET
[Obsolete ("'SetSessionStrengthPolicy' is not available anymore.")]
#else
[Obsolete ("'SetSessionStrengthPolicy' is not available anymore.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
[Unavailable (PlatformName.iOS, message : "'SetSessionStrengthPolicy' is not available anymore.")]
[Unavailable (PlatformName.MacOSX, message : "'SetSessionStrengthPolicy' is not available anymore.")]
[Obsolete ("'SetSessionStrengthPolicy' is not available anymore.")]
#endif
public SslStatus SetSessionStrengthPolicy (SslSessionStrengthPolicy policyStrength)
{
@ -584,16 +590,46 @@ namespace Security {
}
#endif
#if !NET
[iOS (10,0)][Mac (10,12)]
#if NET
[SupportedOSPlatform ("ios10.0")]
[SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("tvos10.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (10,0)]
[Mac (10,12)]
[TV (10,0)]
[Watch (3,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern int SSLSetSessionConfig (IntPtr /* SSLContextRef* */ context, IntPtr /* CFStringRef* */ config);
#if !NET
[iOS (10,0)][Mac (10,12)]
#if NET
[SupportedOSPlatform ("ios10.0")]
[SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("tvos10.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (10,0)]
[Mac (10,12)]
[TV (10,0)]
[Watch (3,0)]
#endif
@ -606,8 +642,23 @@ namespace Security {
return SSLSetSessionConfig (Handle, config.Handle);
}
#if !NET
[iOS (10,0)][Mac (10,12)]
#if NET
[SupportedOSPlatform ("ios10.0")]
[SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("tvos10.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (10,0)]
[Mac (10,12)]
[TV (10,0)]
#endif
public int SetSessionConfig (SslSessionConfig config)
@ -615,16 +666,46 @@ namespace Security {
return SetSessionConfig (config.GetConstant ()!);
}
#if !NET
[iOS (10,0)][Mac (10,12)]
#if NET
[SupportedOSPlatform ("ios10.0")]
[SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("tvos10.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (10,0)]
[Mac (10,12)]
[Watch (3,0)]
[TV (10,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern int SSLReHandshake (IntPtr /* SSLContextRef* */ context);
#if !NET
[iOS (10,0)][Mac (10,12)]
#if NET
[SupportedOSPlatform ("ios10.0")]
[SupportedOSPlatform ("macos10.12")]
[SupportedOSPlatform ("tvos10.0")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (10,0)]
[Mac (10,12)]
[Watch (3,0)]
[TV (10,0)]
#endif
@ -633,20 +714,62 @@ namespace Security {
return SSLReHandshake (Handle);
}
#if !NET
[iOS (9,0)][Mac (10,11)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.11")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (9,0)]
[Mac (10,11)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* OSStatus */ SslStatus SSLCopyRequestedPeerName (IntPtr /* SSLContextRef* */ context, byte[] /* char* */ peerName, ref nuint /* size_t */ peerNameLen);
#if !NET
[iOS (9,0)][Mac (10,11)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.11")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (9,0)]
[Mac (10,11)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* OSStatus */ SslStatus SSLCopyRequestedPeerNameLength (IntPtr /* SSLContextRef* */ context, ref nuint /* size_t */ peerNameLen);
#if !NET
[iOS (9,0)][Mac (10,11)]
#if NET
[SupportedOSPlatform ("ios9.0")]
[SupportedOSPlatform ("macos10.11")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (9,0)]
[Mac (10,11)]
#endif
public string GetRequestedPeerName ()
{
@ -660,60 +783,144 @@ namespace Security {
return result;
}
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)][Mac (10,13)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* OSStatus */ int SSLSetSessionTicketsEnabled (IntPtr /* SSLContextRef */ context, [MarshalAs (UnmanagedType.I1)] bool /* Boolean */ enabled);
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)][Mac (10,13)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13)]
#endif
public int SetSessionTickets (bool enabled)
{
return SSLSetSessionTicketsEnabled (Handle, enabled);
}
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)][Mac (10,13)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* OSStatus */ int SSLSetError (IntPtr /* SSLContextRef */ context, SecStatusCode /* OSStatus */ status);
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)][Mac (10,13)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13)]
#endif
public int SetError (SecStatusCode status)
{
return SSLSetError (Handle, status);
}
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)][Mac (10,13)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* OSStatus */ int SSLSetOCSPResponse (IntPtr /* SSLContextRef */ context, IntPtr /* CFDataRef __nonnull */ response);
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)][Mac (10,13)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13)]
#endif
public int SetOcspResponse (NSData response)
{
@ -722,22 +929,48 @@ namespace Security {
return SSLSetOCSPResponse (Handle, response.Handle);
}
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)]
[Mac (10,13,4)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13.4")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13,4)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* OSStatus */ int SSLSetALPNProtocols (IntPtr /* SSLContextRef */ context, IntPtr /* CFArrayRef */ protocols);
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)]
[Mac (10,13,4)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13.4")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13,4)]
#endif
public int SetAlpnProtocols (string[] protocols)
{
@ -745,22 +978,48 @@ namespace Security {
return SSLSetALPNProtocols (Handle, array.Handle);
}
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)]
[Mac (10,13,4)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13.4")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13,4)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* OSStatus */ int SSLCopyALPNProtocols (IntPtr /* SSLContextRef */ context, ref IntPtr /* CFArrayRef* */ protocols);
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)]
[Mac (10,13,4)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13.4")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13,4)]
#endif
public string?[] GetAlpnProtocols (out int error)
@ -772,12 +1031,25 @@ namespace Security {
return CFArray.StringArrayFromHandle (protocols, true)!;
}
#if !NET
[iOS (11,0)][TV (11,0)][Watch (4,0)]
[Mac (10,13,4)]
#else
#if NET
[SupportedOSPlatform ("ios11.0")]
[SupportedOSPlatform ("tvos11.0")]
[SupportedOSPlatform ("macos10.13.4")]
[UnsupportedOSPlatform ("macos10.15")]
[UnsupportedOSPlatform ("tvos13.0")]
[UnsupportedOSPlatform ("ios13.0")]
#if MONOMAC
[Obsolete ("Starting with macos10.15 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios13.0 use 'Network.framework' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[iOS (11,0)]
[TV (11,0)]
[Watch (4,0)]
[Mac (10,13,4)]
#endif
public string?[] GetAlpnProtocols ()
{

Просмотреть файл

@ -129,42 +129,42 @@ namespace Security {
InitializeHandle (handle);
}
#if !NET
#if NET
[UnsupportedOSPlatform ("tvos12.1")]
[UnsupportedOSPlatform ("macos10.14.1")]
[UnsupportedOSPlatform ("ios12.1")]
#if TVOS
[Obsolete ("Starting with tvos12.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.14.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios12.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.iOS, 12,1, message: "Use 'SecTrust.Evaluate (out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 12,1, message: "Use 'SecTrust.Evaluate (out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 5,1, message: "Use 'SecTrust.Evaluate (out NSError)' instead.")]
[Deprecated (PlatformName.MacOSX, 10,14,1, message: "Use 'SecTrust.Evaluate (out NSError)' instead.")]
#else
[UnsupportedOSPlatform ("ios12.1")]
[UnsupportedOSPlatform ("tvos12.1")]
[UnsupportedOSPlatform ("macos10.14.1")]
#if IOS
[Obsolete ("Starting with ios12.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos12.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.14.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[DllImport (Constants.SecurityLibrary)]
extern static SecStatusCode /* OSStatus */ SecTrustEvaluate (IntPtr /* SecTrustRef */ trust, out /* SecTrustResultType */ SecTrustResult result);
#if !NET
#if NET
[UnsupportedOSPlatform ("tvos12.1")]
[UnsupportedOSPlatform ("macos10.14.1")]
[UnsupportedOSPlatform ("ios12.1")]
#if TVOS
[Obsolete ("Starting with tvos12.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.14.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios12.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.iOS, 12, 1, message : "Use 'SecTrust.Evaluate (out NSError)' instead.")]
[Deprecated (PlatformName.TvOS, 12, 1, message : "Use 'SecTrust.Evaluate (out NSError)' instead.")]
[Deprecated (PlatformName.WatchOS, 5, 1, message : "Use 'SecTrust.Evaluate (out NSError)' instead.")]
[Deprecated (PlatformName.MacOSX, 10, 14, 1, message : "Use 'SecTrust.Evaluate (out NSError)' instead.")]
#else
[UnsupportedOSPlatform ("ios12.1")]
[UnsupportedOSPlatform ("tvos12.1")]
[UnsupportedOSPlatform ("macos10.14.1")]
#if IOS
[Obsolete ("Starting with ios12.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos12.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos10.14.1 use 'SecTrust.Evaluate (out NSError)' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public SecTrustResult Evaluate ()
{
@ -186,51 +186,50 @@ namespace Security {
}
}
#if !NET
#if NET
[UnsupportedOSPlatform ("macos12.0")]
[UnsupportedOSPlatform ("maccatalyst15.0")]
[UnsupportedOSPlatform ("tvos15.0")]
[UnsupportedOSPlatform ("ios15.0")]
#if MONOMAC
[Obsolete ("Starting with macos12.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif __MACCATALYST__
[Obsolete ("Starting with maccatalyst15.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos15.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios15.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 12, 0)]
[Deprecated (PlatformName.iOS, 15, 0)]
[Deprecated (PlatformName.MacCatalyst, 15, 0)]
[Deprecated (PlatformName.WatchOS, 8, 0)]
[Deprecated (PlatformName.TvOS, 15, 0)]
#else
[UnsupportedOSPlatform ("macos12.0")]
[UnsupportedOSPlatform ("ios15.0")]
[UnsupportedOSPlatform ("tvos15.0")]
[UnsupportedOSPlatform ("maccatalyst15.0")]
#if __MACCATALYST__
[Obsolete ("Starting with maccatalyst15.0 API removed, please do not use.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios15.0 API removed, please do not use.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos15.0 API removed, please do not use.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos12.0 API removed, please do not use.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
[DllImport (Constants.SecurityLibrary)]
extern static IntPtr /* SecCertificateRef */ SecTrustGetCertificateAtIndex (IntPtr /* SecTrustRef */ trust, nint /* CFIndex */ ix);
#if !NET
#if NET
[UnsupportedOSPlatform ("macos12.0")]
[UnsupportedOSPlatform ("maccatalyst15.0")]
[UnsupportedOSPlatform ("tvos15.0")]
[UnsupportedOSPlatform ("ios15.0")]
#if MONOMAC
[Obsolete ("Starting with macos12.0 use the 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif __MACCATALYST__
[Obsolete ("Starting with maccatalyst15.0 use the 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos15.0 use the 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios15.0 use the 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.MacOSX, 12, 0, message: "Use the 'GetCertificateChain' method instead.")]
[Deprecated (PlatformName.iOS, 15, 0, message: "Use the 'GetCertificateChain' method instead.")]
[Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use the 'GetCertificateChain' method instead.")]
[Deprecated (PlatformName.WatchOS, 8, 0, message: "Use the 'GetCertificateChain' method instead.")]
[Deprecated (PlatformName.TvOS, 15, 0, message: "Use the 'GetCertificateChain' method instead.")]
#else
[UnsupportedOSPlatform ("macos12.0")]
[UnsupportedOSPlatform ("ios15.0")]
[UnsupportedOSPlatform ("tvos15.0")]
[UnsupportedOSPlatform ("maccatalyst15.0")]
#if __MACCATALYST__
[Obsolete ("Starting with maccatalyst15.0 use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios15.0 please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos15.0 please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos12.0 please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public SecCertificate this [nint index] {
get {
@ -242,101 +241,120 @@ namespace Security {
}
#if NET
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("tvos15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
[SupportedOSPlatform ("macos12.0")]
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
#endif
[DllImport (Constants.SecurityLibrary)]
static extern /* CFArrayRef */ IntPtr SecTrustCopyCertificateChain (/* SecTrustRef */ IntPtr trust);
#if NET
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("tvos15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
[SupportedOSPlatform ("macos12.0")]
[SupportedOSPlatform ("ios15.0")]
[SupportedOSPlatform ("maccatalyst15.0")]
#else
[Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)]
[Watch (8,0)]
[TV (15,0)]
[Mac (12,0)]
[iOS (15,0)]
[MacCatalyst (15,0)]
#endif
public SecCertificate[] GetCertificateChain ()
=> NSArray.ArrayFromHandle<SecCertificate> (SecTrustCopyCertificateChain (Handle));
#if !NET
#if NET
[UnsupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("tvos14.0")]
[UnsupportedOSPlatform ("ios14.0")]
#if MONOMAC
[Obsolete ("Starting with macos11.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos14.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios14.0.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.iOS, 14,0)]
[Deprecated (PlatformName.MacOSX, 11,0)]
[Deprecated (PlatformName.TvOS, 14,0)]
[Deprecated (PlatformName.WatchOS, 7,0)]
#else
[UnsupportedOSPlatform ("ios14.0")]
[UnsupportedOSPlatform ("tvos14.0")]
[UnsupportedOSPlatform ("macos11.0")]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static IntPtr /* SecKeyRef */ SecTrustCopyPublicKey (IntPtr /* SecTrustRef */ trust);
#if !NET
#if NET
[UnsupportedOSPlatform ("macos11.0")]
[UnsupportedOSPlatform ("tvos14.0")]
[UnsupportedOSPlatform ("ios14.0")]
#if MONOMAC
[Obsolete ("Starting with macos11.0 use 'GetKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos14.0 use 'GetKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif IOS
[Obsolete ("Starting with ios14.0 use 'GetKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#else
[Deprecated (PlatformName.iOS, 14,0, message: "Use 'GetKey' instead.")]
[Deprecated (PlatformName.MacOSX, 11,0, message: "Use 'GetKey' instead.")]
[Deprecated (PlatformName.TvOS, 14,0, message: "Use 'GetKey' instead.")]
[Deprecated (PlatformName.WatchOS, 7,0, message: "Use 'GetKey' instead.")]
#else
[UnsupportedOSPlatform ("ios14.0")]
[UnsupportedOSPlatform ("tvos14.0")]
[UnsupportedOSPlatform ("macos11.0")]
#if IOS
[Obsolete ("Starting with ios14.0 use 'GetKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif TVOS
[Obsolete ("Starting with tvos14.0 use 'GetKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#elif MONOMAC
[Obsolete ("Starting with macos11.0 use 'GetKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")]
#endif
#endif
public SecKey GetPublicKey ()
{
return new SecKey (SecTrustCopyPublicKey (GetCheckedHandle ()), true);
}
#if !NET
#if NET
[SupportedOSPlatform ("ios14.0")]
[SupportedOSPlatform ("tvos14.0")]
[SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst14.0")]
#else
[iOS (14,0)]
[TV (14,0)]
[Watch (7,0)]
[Mac (11,0)]
[MacCatalyst (14,0)]
#else
[SupportedOSPlatform ("ios14.0")]
[SupportedOSPlatform ("tvos14.0")]
[SupportedOSPlatform ("maccatalyst14.0")]
[SupportedOSPlatform ("macos11.0")]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static IntPtr /* SecKeyRef */ SecTrustCopyKey (IntPtr /* SecTrustRef */ trust);
#if !NET
#if NET
[SupportedOSPlatform ("ios14.0")]
[SupportedOSPlatform ("tvos14.0")]
[SupportedOSPlatform ("macos11.0")]
[SupportedOSPlatform ("maccatalyst14.0")]
#else
[iOS (14,0)]
[TV (14,0)]
[Watch (7,0)]
[Mac (11,0)]
[MacCatalyst (14,0)]
#else
[SupportedOSPlatform ("ios14.0")]
[SupportedOSPlatform ("tvos14.0")]
[SupportedOSPlatform ("maccatalyst14.0")]
[SupportedOSPlatform ("macos11.0")]
#endif
public SecKey GetKey ()
{
return new SecKey (SecTrustCopyKey (GetCheckedHandle ()), true);
}
#if !NET
#if NET
[SupportedOSPlatform ("macos10.9")]
#else
[Mac (10,9)]
#endif
[DllImport (Constants.SecurityLibrary)]
extern static IntPtr /* CFDataRef */ SecTrustCopyExceptions (IntPtr /* SecTrustRef */ trust);
#if !NET
#if NET
[SupportedOSPlatform ("macos10.9")]
#else
[Mac (10,9)]
#endif
public NSData? GetExceptions ()
@ -344,14 +362,18 @@ namespace Security {
return Runtime.GetNSObject<NSData> (SecTrustCopyExceptions (GetCheckedHandle ()), true);
}
#if !NET
#if NET
[SupportedOSPlatform ("macos10.9")]
#else
[Mac (10,9)]
#endif
[DllImport (Constants.SecurityLibrary)]
[return: MarshalAs (UnmanagedType.U1)]
extern static bool SecTrustSetExceptions (IntPtr /* SecTrustRef */ trust, IntPtr /* __nullable CFDataRef */ exceptions);
#if !NET
#if NET
[SupportedOSPlatform ("macos10.9")]
#else
[Mac (10,9)]
#endif
public bool SetExceptions (NSData data)

Просмотреть файл

@ -1 +0,0 @@
!extra-enum-value! Managed value 32 for SecAccessControlCreateFlags.Watch is available for the current platform while the value in the native header is not

Просмотреть файл

@ -1 +0,0 @@
!extra-enum-value! Managed value 32 for SecAccessControlCreateFlags.Watch is available for the current platform while the value in the native header is not