From ef1de3b6eb2693474773061dc2cad9d836066b6e Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Thu, 5 Aug 2021 15:37:45 -0400 Subject: [PATCH 1/3] [Security] Add Xcode 13 beta 4 support. --- src/Security/Authorization.cs | 38 ++- src/Security/Certificate.cs | 32 +++ src/Security/Trust.cs | 30 +++ .../xtro-sharpie/MacCatalyst-Security.ignore | 221 +++++++++++++++++ tests/xtro-sharpie/MacCatalyst-Security.todo | 222 ------------------ tests/xtro-sharpie/iOS-Security.todo | 7 - tests/xtro-sharpie/macOS-Security.todo | 1 - tests/xtro-sharpie/tvOS-Security.todo | 7 - tests/xtro-sharpie/watchOS-Security.todo | 7 - 9 files changed, 320 insertions(+), 245 deletions(-) delete mode 100644 tests/xtro-sharpie/MacCatalyst-Security.todo delete mode 100644 tests/xtro-sharpie/iOS-Security.todo delete mode 100644 tests/xtro-sharpie/macOS-Security.todo delete mode 100644 tests/xtro-sharpie/tvOS-Security.todo delete mode 100644 tests/xtro-sharpie/watchOS-Security.todo diff --git a/src/Security/Authorization.cs b/src/Security/Authorization.cs index 502135f6ef55..87e66840ce7b 100644 --- a/src/Security/Authorization.cs +++ b/src/Security/Authorization.cs @@ -25,7 +25,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // -#if MONOMAC +#if MONOMAC || __MACCATALYST__ using ObjCRuntime; using Foundation; @@ -33,6 +33,12 @@ using System.Runtime.InteropServices; namespace Security { + +#if NET + [SupportedOSPlatform ("maccatalyst15.0")] +#else + [MacCatalyst (15,0)] +#endif // Untyped enum in ObjC public enum AuthorizationStatus { Success = 0, @@ -52,6 +58,11 @@ public enum AuthorizationStatus { BadAddress = -60033, } +#if NET + [SupportedOSPlatform ("maccatalyst15.0")] +#else + [MacCatalyst (15,0)] +#endif // typedef UInt32 AuthorizationFlags; [Flags] public enum AuthorizationFlags : int { @@ -68,18 +79,33 @@ public enum AuthorizationFlags : int { // For ease of use, we let the user pass the AuthorizationParameters, and we // create the structure for them with the proper data // +#if NET + [SupportedOSPlatform ("maccatalyst15.0")] +#else + [MacCatalyst (15,0)] +#endif public class AuthorizationParameters { public string PathToSystemPrivilegeTool; public string Prompt; public string IconPath; } +#if NET + [SupportedOSPlatform ("maccatalyst15.0")] +#else + [MacCatalyst (15,0)] +#endif public class AuthorizationEnvironment { public string Username; public string Password; public bool AddToSharedCredentialPool; } +#if NET + [SupportedOSPlatform ("maccatalyst15.0")] +#else + [MacCatalyst (15,0)] +#endif [StructLayout (LayoutKind.Sequential)] struct AuthorizationItem { public IntPtr /* AuthorizationString = const char * */ name; @@ -88,11 +114,21 @@ struct AuthorizationItem { public int /* UInt32 */ flags; // zero } +#if NET + [SupportedOSPlatform ("maccatalyst15.0")] +#else + [MacCatalyst (15,0)] +#endif unsafe struct AuthorizationItemSet { public int /* UInt32 */ count; public AuthorizationItem * /* AuthorizationItem* */ ptrToAuthorization; } +#if NET + [SupportedOSPlatform ("maccatalyst15.0")] +#else + [MacCatalyst (15,0)] +#endif public unsafe class Authorization : INativeObject, IDisposable { IntPtr handle; diff --git a/src/Security/Certificate.cs b/src/Security/Certificate.cs index ee5451f4ea89..8645a81bf698 100644 --- a/src/Security/Certificate.cs +++ b/src/Security/Certificate.cs @@ -551,11 +551,19 @@ public SecKey (IntPtr handle, bool owns) [DllImport (Constants.SecurityLibrary, EntryPoint="SecKeyGetTypeID")] public extern static nint GetTypeID (); + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyGeneratePair (IntPtr dictHandle, out IntPtr pubKey, out IntPtr privKey); // TODO: pull all the TypeRefs needed for the NSDictionary + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CreateRandomKey' instead.")] + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CreateRandomKey' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CreateRandomKey' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CreateRandomKey' instead.")] public static SecStatusCode GenerateKeyPair (NSDictionary parameters, out SecKey publicKey, out SecKey privateKey) { if (parameters == null) @@ -625,9 +633,15 @@ public int BlockSize { } } + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateSignature' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateSignature' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyCreateSignature' instead.")] [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyRawSign (IntPtr handle, SecPadding padding, IntPtr dataToSign, nint dataToSignLen, IntPtr sig, ref nint sigLen); + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CreateSignature' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CreateSignature' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CreateSignature' instead.")] public SecStatusCode RawSign (SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) { if (handle == IntPtr.Zero) @@ -661,9 +675,15 @@ unsafe SecStatusCode _RawSign (SecPadding padding, IntPtr dataToSign, int dataTo return status; } + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyVerifySignature' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyVerifySignature' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyVerifySignature' instead.")] [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyRawVerify (IntPtr handle, SecPadding padding, IntPtr signedData, nint signedLen, IntPtr sign, nint signLen); + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'VerifySignature' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'VerifySignature' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'VerifySignature' instead.")] public unsafe SecStatusCode RawVerify (SecPadding padding, IntPtr signedData, int signedDataLen, IntPtr signature, int signatureLen) { if (handle == IntPtr.Zero) @@ -694,9 +714,15 @@ public SecStatusCode RawVerify (SecPadding padding, byte [] signedData, byte [] } } + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateEncryptedData' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateEncryptedData' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyCreateEncryptedData' instead.")] [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyEncrypt (IntPtr handle, SecPadding padding, IntPtr plainText, nint plainTextLen, IntPtr cipherText, ref nint cipherTextLengh); + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CreateEncryptedData' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CreateEncryptedData' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CreateEncryptedData' instead.")] public unsafe SecStatusCode Encrypt (SecPadding padding, IntPtr plainText, nint plainTextLen, IntPtr cipherText, ref nint cipherTextLen) { if (handle == IntPtr.Zero) @@ -729,9 +755,15 @@ public SecStatusCode Encrypt (SecPadding padding, byte [] plainText, out byte [] return Encrypt (padding, plainText, cipherText); } + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateDecryptedData' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateDecryptedData' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyCreateDecryptedData' instead.")] [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyDecrypt (IntPtr handle, SecPadding padding, IntPtr cipherTextLen, nint cipherLen, IntPtr plainText, ref nint plainTextLen); + [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CreateDecryptedData' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CreateDecryptedData' instead.")] + [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CreateDecryptedData' instead.")] public unsafe SecStatusCode Decrypt (SecPadding padding, IntPtr cipherText, nint cipherTextLen, IntPtr plainText, ref nint plainTextLen) { if (handle == IntPtr.Zero) diff --git a/src/Security/Trust.cs b/src/Security/Trust.cs index 6af47914f1b4..d188c428df89 100644 --- a/src/Security/Trust.cs +++ b/src/Security/Trust.cs @@ -159,9 +159,17 @@ public int Count { } } + [Deprecated (PlatformName.MacOSX, 12, 0)] + [Deprecated (PlatformName.iOS, 15, 0)] + [Deprecated (PlatformName.WatchOS, 8, 0)] + [Deprecated (PlatformName.TvOS, 15, 0)] [DllImport (Constants.SecurityLibrary)] extern static IntPtr /* SecCertificateRef */ SecTrustGetCertificateAtIndex (IntPtr /* SecTrustRef */ trust, nint /* CFIndex */ ix); + [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use the 'GetCertificateChain' method instead.")] + [Deprecated (PlatformName.iOS, 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.")] public SecCertificate this [nint index] { get { if (handle == IntPtr.Zero) @@ -173,6 +181,28 @@ public SecCertificate this [nint index] { } } +#if NET + [SupportedOSPlatform ("ios15.0")] + [SupportedOSPlatform ("tvos15.0")] + [SupportedOSPlatform ("maccatalyst15.0")] + [SupportedOSPlatform ("macos12.0") +#else + [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") +#else + [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] +#endif + public SecCertificate[] GetCertificateChain () + => NSArray.ArrayFromHandle (SecTrustCopyCertificateChain (handle)); + [Deprecated (PlatformName.iOS, 14,0)] [Deprecated (PlatformName.MacOSX, 11,0)] [Deprecated (PlatformName.TvOS, 14,0)] diff --git a/tests/xtro-sharpie/MacCatalyst-Security.ignore b/tests/xtro-sharpie/MacCatalyst-Security.ignore index 10b023aa350d..a36a0adefad8 100644 --- a/tests/xtro-sharpie/MacCatalyst-Security.ignore +++ b/tests/xtro-sharpie/MacCatalyst-Security.ignore @@ -1,2 +1,223 @@ # deprecated !missing-pinvoke! SecCertificateCopyPublicKey is not bound + +# follow the macOS pattern that ignores all of the following ones +!missing-enum! AuthorizationContextFlags not bound +!missing-enum! AuthorizationResult not bound +!missing-enum! SecCSDigestAlgorithm not bound +!missing-enum! SecCSFlags not bound +!missing-enum! SecCodeSignatureFlags not bound +!missing-enum! SecCodeStatus not bound +!missing-enum! SecRequirementType not bound +!missing-enum! SessionAttributeBits not bound +!missing-enum! SessionCreationFlags not bound +!missing-enum! _SecureDownloadTrustCallbackResult not bound +!missing-field! kSecAsn1AnyTemplate not bound +!missing-field! kSecAsn1BMPStringTemplate not bound +!missing-field! kSecAsn1BitStringTemplate not bound +!missing-field! kSecAsn1BooleanTemplate not bound +!missing-field! kSecAsn1EnumeratedTemplate not bound +!missing-field! kSecAsn1GeneralizedTimeTemplate not bound +!missing-field! kSecAsn1IA5StringTemplate not bound +!missing-field! kSecAsn1IntegerTemplate not bound +!missing-field! kSecAsn1NullTemplate not bound +!missing-field! kSecAsn1ObjectIDTemplate not bound +!missing-field! kSecAsn1OctetStringTemplate not bound +!missing-field! kSecAsn1PointerToAnyTemplate not bound +!missing-field! kSecAsn1PointerToBMPStringTemplate not bound +!missing-field! kSecAsn1PointerToBitStringTemplate not bound +!missing-field! kSecAsn1PointerToBooleanTemplate not bound +!missing-field! kSecAsn1PointerToEnumeratedTemplate not bound +!missing-field! kSecAsn1PointerToGeneralizedTimeTemplate not bound +!missing-field! kSecAsn1PointerToIA5StringTemplate not bound +!missing-field! kSecAsn1PointerToIntegerTemplate not bound +!missing-field! kSecAsn1PointerToNullTemplate not bound +!missing-field! kSecAsn1PointerToObjectIDTemplate not bound +!missing-field! kSecAsn1PointerToOctetStringTemplate not bound +!missing-field! kSecAsn1PointerToPrintableStringTemplate not bound +!missing-field! kSecAsn1PointerToT61StringTemplate not bound +!missing-field! kSecAsn1PointerToTeletexStringTemplate not bound +!missing-field! kSecAsn1PointerToUTCTimeTemplate not bound +!missing-field! kSecAsn1PointerToUTF8StringTemplate not bound +!missing-field! kSecAsn1PointerToUniversalStringTemplate not bound +!missing-field! kSecAsn1PointerToVisibleStringTemplate not bound +!missing-field! kSecAsn1PrintableStringTemplate not bound +!missing-field! kSecAsn1SequenceOfAnyTemplate not bound +!missing-field! kSecAsn1SequenceOfBMPStringTemplate not bound +!missing-field! kSecAsn1SequenceOfBitStringTemplate not bound +!missing-field! kSecAsn1SequenceOfBooleanTemplate not bound +!missing-field! kSecAsn1SequenceOfEnumeratedTemplate not bound +!missing-field! kSecAsn1SequenceOfGeneralizedTimeTemplate not bound +!missing-field! kSecAsn1SequenceOfIA5StringTemplate not bound +!missing-field! kSecAsn1SequenceOfIntegerTemplate not bound +!missing-field! kSecAsn1SequenceOfNullTemplate not bound +!missing-field! kSecAsn1SequenceOfObjectIDTemplate not bound +!missing-field! kSecAsn1SequenceOfOctetStringTemplate not bound +!missing-field! kSecAsn1SequenceOfPrintableStringTemplate not bound +!missing-field! kSecAsn1SequenceOfT61StringTemplate not bound +!missing-field! kSecAsn1SequenceOfTeletexStringTemplate not bound +!missing-field! kSecAsn1SequenceOfUTCTimeTemplate not bound +!missing-field! kSecAsn1SequenceOfUTF8StringTemplate not bound +!missing-field! kSecAsn1SequenceOfUniversalStringTemplate not bound +!missing-field! kSecAsn1SequenceOfVisibleStringTemplate not bound +!missing-field! kSecAsn1SetOfAnyTemplate not bound +!missing-field! kSecAsn1SetOfBMPStringTemplate not bound +!missing-field! kSecAsn1SetOfBitStringTemplate not bound +!missing-field! kSecAsn1SetOfBooleanTemplate not bound +!missing-field! kSecAsn1SetOfEnumeratedTemplate not bound +!missing-field! kSecAsn1SetOfGeneralizedTimeTemplate not bound +!missing-field! kSecAsn1SetOfIA5StringTemplate not bound +!missing-field! kSecAsn1SetOfIntegerTemplate not bound +!missing-field! kSecAsn1SetOfNullTemplate not bound +!missing-field! kSecAsn1SetOfObjectIDTemplate not bound +!missing-field! kSecAsn1SetOfOctetStringTemplate not bound +!missing-field! kSecAsn1SetOfPrintableStringTemplate not bound +!missing-field! kSecAsn1SetOfT61StringTemplate not bound +!missing-field! kSecAsn1SetOfTeletexStringTemplate not bound +!missing-field! kSecAsn1SetOfUTCTimeTemplate not bound +!missing-field! kSecAsn1SetOfUTF8StringTemplate not bound +!missing-field! kSecAsn1SetOfUniversalStringTemplate not bound +!missing-field! kSecAsn1SetOfVisibleStringTemplate not bound +!missing-field! kSecAsn1SkipTemplate not bound +!missing-field! kSecAsn1T61StringTemplate not bound +!missing-field! kSecAsn1TeletexStringTemplate not bound +!missing-field! kSecAsn1UTCTimeTemplate not bound +!missing-field! kSecAsn1UTF8StringTemplate not bound +!missing-field! kSecAsn1UniversalStringTemplate not bound +!missing-field! kSecAsn1UnsignedIntegerTemplate not bound +!missing-field! kSecAsn1VisibleStringTemplate not bound +!missing-field! kSecAttrAccess not bound +!missing-field! kSecAttrKeyType3DES not bound +!missing-field! kSecAttrKeyTypeAES not bound +!missing-field! kSecAttrKeyTypeCAST not bound +!missing-field! kSecAttrKeyTypeDES not bound +!missing-field! kSecAttrKeyTypeDSA not bound +!missing-field! kSecAttrKeyTypeECDSA not bound +!missing-field! kSecAttrKeyTypeRC2 not bound +!missing-field! kSecAttrKeyTypeRC4 not bound +!missing-field! kSecAttrPRF not bound +!missing-field! kSecAttrPRFHmacAlgSHA1 not bound +!missing-field! kSecAttrPRFHmacAlgSHA224 not bound +!missing-field! kSecAttrPRFHmacAlgSHA256 not bound +!missing-field! kSecAttrPRFHmacAlgSHA384 not bound +!missing-field! kSecAttrPRFHmacAlgSHA512 not bound +!missing-field! kSecAttrRounds not bound +!missing-field! kSecAttrSalt not bound +!missing-field! kSecCFErrorArchitecture not bound +!missing-field! kSecCFErrorGuestAttributes not bound +!missing-field! kSecCFErrorInfoPlist not bound +!missing-field! kSecCFErrorPath not bound +!missing-field! kSecCFErrorPattern not bound +!missing-field! kSecCFErrorRequirementSyntax not bound +!missing-field! kSecCFErrorResourceAdded not bound +!missing-field! kSecCFErrorResourceAltered not bound +!missing-field! kSecCFErrorResourceMissing not bound +!missing-field! kSecCFErrorResourceSeal not bound +!missing-field! kSecCFErrorResourceSideband not bound +!missing-field! kSecCodeAttributeArchitecture not bound +!missing-field! kSecCodeAttributeBundleVersion not bound +!missing-field! kSecCodeAttributeSubarchitecture not bound +!missing-field! kSecCodeAttributeUniversalFileOffset not bound +!missing-field! kSecCodeInfoCMS not bound +!missing-field! kSecCodeInfoCdHashes not bound +!missing-field! kSecCodeInfoCertificates not bound +!missing-field! kSecCodeInfoChangedFiles not bound +!missing-field! kSecCodeInfoDesignatedRequirement not bound +!missing-field! kSecCodeInfoDigestAlgorithm not bound +!missing-field! kSecCodeInfoDigestAlgorithms not bound +!missing-field! kSecCodeInfoEntitlements not bound +!missing-field! kSecCodeInfoEntitlementsDict not bound +!missing-field! kSecCodeInfoFlags not bound +!missing-field! kSecCodeInfoFormat not bound +!missing-field! kSecCodeInfoIdentifier not bound +!missing-field! kSecCodeInfoImplicitDesignatedRequirement not bound +!missing-field! kSecCodeInfoMainExecutable not bound +!missing-field! kSecCodeInfoPList not bound +!missing-field! kSecCodeInfoPlatformIdentifier not bound +!missing-field! kSecCodeInfoRequirementData not bound +!missing-field! kSecCodeInfoRequirements not bound +!missing-field! kSecCodeInfoRuntimeVersion not bound +!missing-field! kSecCodeInfoSource not bound +!missing-field! kSecCodeInfoStatus not bound +!missing-field! kSecCodeInfoTeamIdentifier not bound +!missing-field! kSecCodeInfoTime not bound +!missing-field! kSecCodeInfoTimestamp not bound +!missing-field! kSecCodeInfoTrust not bound +!missing-field! kSecCodeInfoUnique not bound +!missing-field! kSecGuestAttributeArchitecture not bound +!missing-field! kSecGuestAttributeAudit not bound +!missing-field! kSecGuestAttributeCanonical not bound +!missing-field! kSecGuestAttributeDynamicCode not bound +!missing-field! kSecGuestAttributeDynamicCodeInfoPlist not bound +!missing-field! kSecGuestAttributeHash not bound +!missing-field! kSecGuestAttributeMachPort not bound +!missing-field! kSecGuestAttributePid not bound +!missing-field! kSecGuestAttributeSubarchitecture not bound +!missing-field! kSecImportExportAccess not bound +!missing-field! kSecImportExportKeychain not bound +!missing-field! kSecMatchDiacriticInsensitive not bound +!missing-field! kSecMatchSubjectEndsWith not bound +!missing-field! kSecMatchSubjectStartsWith not bound +!missing-field! kSecMatchSubjectWholeString not bound +!missing-field! kSecMatchWidthInsensitive not bound +!missing-field! kSecPolicyApplePKINITClient not bound +!missing-field! kSecPolicyApplePKINITServer not bound +!missing-field! kSecUseKeychain not bound +!missing-pinvoke! AuthorizationCopyInfo is not bound +!missing-pinvoke! AuthorizationCopyPrivilegedReference is not bound +!missing-pinvoke! AuthorizationCopyRights is not bound +!missing-pinvoke! AuthorizationCopyRightsAsync is not bound +!missing-pinvoke! AuthorizationCreateFromExternalForm is not bound +!missing-pinvoke! AuthorizationFreeItemSet is not bound +!missing-pinvoke! AuthorizationMakeExternalForm is not bound +!missing-pinvoke! AuthorizationPluginCreate is not bound +!missing-pinvoke! SecAsn1AllocCopy is not bound +!missing-pinvoke! SecAsn1AllocCopyItem is not bound +!missing-pinvoke! SecAsn1AllocItem is not bound +!missing-pinvoke! SecAsn1CoderCreate is not bound +!missing-pinvoke! SecAsn1CoderRelease is not bound +!missing-pinvoke! SecAsn1Decode is not bound +!missing-pinvoke! SecAsn1DecodeData is not bound +!missing-pinvoke! SecAsn1EncodeItem is not bound +!missing-pinvoke! SecAsn1Malloc is not bound +!missing-pinvoke! SecAsn1OidCompare is not bound +!missing-pinvoke! SecCodeCheckValidity is not bound +!missing-pinvoke! SecCodeCheckValidityWithErrors is not bound +!missing-pinvoke! SecCodeCopyDesignatedRequirement is not bound +!missing-pinvoke! SecCodeCopyHost is not bound +!missing-pinvoke! SecCodeCopyPath is not bound +!missing-pinvoke! SecCodeCopySelf is not bound +!missing-pinvoke! SecCodeCopySigningInformation is not bound +!missing-pinvoke! SecCodeCopyStaticCode is not bound +!missing-pinvoke! SecCodeGetTypeID is not bound +!missing-pinvoke! SecCodeMapMemory is not bound +!missing-pinvoke! SecRequirementCopyData is not bound +!missing-pinvoke! SecRequirementCopyString is not bound +!missing-pinvoke! SecRequirementCreateWithData is not bound +!missing-pinvoke! SecRequirementCreateWithString is not bound +!missing-pinvoke! SecRequirementCreateWithStringAndErrors is not bound +!missing-pinvoke! SecRequirementGetTypeID is not bound +!missing-pinvoke! SecStaticCodeCheckValidity is not bound +!missing-pinvoke! SecStaticCodeCheckValidityWithErrors is not bound +!missing-pinvoke! SecStaticCodeCreateWithPath is not bound +!missing-pinvoke! SecStaticCodeCreateWithPathAndAttributes is not bound +!missing-pinvoke! SecStaticCodeGetTypeID is not bound +!missing-pinvoke! SecureDownloadCopyCreationDate is not bound +!missing-pinvoke! SecureDownloadCopyName is not bound +!missing-pinvoke! SecureDownloadCopyTicketLocation is not bound +!missing-pinvoke! SecureDownloadCopyURLs is not bound +!missing-pinvoke! SecureDownloadCreateWithTicket is not bound +!missing-pinvoke! SecureDownloadFinished is not bound +!missing-pinvoke! SecureDownloadGetDownloadSize is not bound +!missing-pinvoke! SecureDownloadRelease is not bound +!missing-pinvoke! SecureDownloadUpdateWithData is not bound +!missing-pinvoke! SessionCreate is not bound +!missing-pinvoke! SessionGetInfo is not bound + +# Only shown MacCatalyst and there is not public documentation about them. + +!missing-pinvoke! sec_protocol_options_get_enable_encrypted_client_hello is not bound +!missing-pinvoke! sec_protocol_options_get_quic_use_legacy_codepoint is not bound +!missing-pinvoke! sec_protocol_options_set_enable_encrypted_client_hello is not bound +!missing-pinvoke! sec_protocol_options_set_peer_authentication_optional is not bound +!missing-pinvoke! sec_protocol_options_set_quic_use_legacy_codepoint is not bound diff --git a/tests/xtro-sharpie/MacCatalyst-Security.todo b/tests/xtro-sharpie/MacCatalyst-Security.todo deleted file mode 100644 index ad25ba2ee480..000000000000 --- a/tests/xtro-sharpie/MacCatalyst-Security.todo +++ /dev/null @@ -1,222 +0,0 @@ -!missing-enum! _SecureDownloadTrustCallbackResult not bound -!missing-enum! AuthorizationContextFlags not bound -!missing-enum! AuthorizationFlags not bound -!missing-enum! AuthorizationResult not bound -!missing-enum! SecCodeSignatureFlags not bound -!missing-enum! SecCodeStatus not bound -!missing-enum! SecCSDigestAlgorithm not bound -!missing-enum! SecCSFlags not bound -!missing-enum! SecRequirementType not bound -!missing-enum! SessionAttributeBits not bound -!missing-enum! SessionCreationFlags not bound -!missing-field! kSecAsn1AnyTemplate not bound -!missing-field! kSecAsn1BitStringTemplate not bound -!missing-field! kSecAsn1BMPStringTemplate not bound -!missing-field! kSecAsn1BooleanTemplate not bound -!missing-field! kSecAsn1EnumeratedTemplate not bound -!missing-field! kSecAsn1GeneralizedTimeTemplate not bound -!missing-field! kSecAsn1IA5StringTemplate not bound -!missing-field! kSecAsn1IntegerTemplate not bound -!missing-field! kSecAsn1NullTemplate not bound -!missing-field! kSecAsn1ObjectIDTemplate not bound -!missing-field! kSecAsn1OctetStringTemplate not bound -!missing-field! kSecAsn1PointerToAnyTemplate not bound -!missing-field! kSecAsn1PointerToBitStringTemplate not bound -!missing-field! kSecAsn1PointerToBMPStringTemplate not bound -!missing-field! kSecAsn1PointerToBooleanTemplate not bound -!missing-field! kSecAsn1PointerToEnumeratedTemplate not bound -!missing-field! kSecAsn1PointerToGeneralizedTimeTemplate not bound -!missing-field! kSecAsn1PointerToIA5StringTemplate not bound -!missing-field! kSecAsn1PointerToIntegerTemplate not bound -!missing-field! kSecAsn1PointerToNullTemplate not bound -!missing-field! kSecAsn1PointerToObjectIDTemplate not bound -!missing-field! kSecAsn1PointerToOctetStringTemplate not bound -!missing-field! kSecAsn1PointerToPrintableStringTemplate not bound -!missing-field! kSecAsn1PointerToT61StringTemplate not bound -!missing-field! kSecAsn1PointerToTeletexStringTemplate not bound -!missing-field! kSecAsn1PointerToUniversalStringTemplate not bound -!missing-field! kSecAsn1PointerToUTCTimeTemplate not bound -!missing-field! kSecAsn1PointerToUTF8StringTemplate not bound -!missing-field! kSecAsn1PointerToVisibleStringTemplate not bound -!missing-field! kSecAsn1PrintableStringTemplate not bound -!missing-field! kSecAsn1SequenceOfAnyTemplate not bound -!missing-field! kSecAsn1SequenceOfBitStringTemplate not bound -!missing-field! kSecAsn1SequenceOfBMPStringTemplate not bound -!missing-field! kSecAsn1SequenceOfBooleanTemplate not bound -!missing-field! kSecAsn1SequenceOfEnumeratedTemplate not bound -!missing-field! kSecAsn1SequenceOfGeneralizedTimeTemplate not bound -!missing-field! kSecAsn1SequenceOfIA5StringTemplate not bound -!missing-field! kSecAsn1SequenceOfIntegerTemplate not bound -!missing-field! kSecAsn1SequenceOfNullTemplate not bound -!missing-field! kSecAsn1SequenceOfObjectIDTemplate not bound -!missing-field! kSecAsn1SequenceOfOctetStringTemplate not bound -!missing-field! kSecAsn1SequenceOfPrintableStringTemplate not bound -!missing-field! kSecAsn1SequenceOfT61StringTemplate not bound -!missing-field! kSecAsn1SequenceOfTeletexStringTemplate not bound -!missing-field! kSecAsn1SequenceOfUniversalStringTemplate not bound -!missing-field! kSecAsn1SequenceOfUTCTimeTemplate not bound -!missing-field! kSecAsn1SequenceOfUTF8StringTemplate not bound -!missing-field! kSecAsn1SequenceOfVisibleStringTemplate not bound -!missing-field! kSecAsn1SetOfAnyTemplate not bound -!missing-field! kSecAsn1SetOfBitStringTemplate not bound -!missing-field! kSecAsn1SetOfBMPStringTemplate not bound -!missing-field! kSecAsn1SetOfBooleanTemplate not bound -!missing-field! kSecAsn1SetOfEnumeratedTemplate not bound -!missing-field! kSecAsn1SetOfGeneralizedTimeTemplate not bound -!missing-field! kSecAsn1SetOfIA5StringTemplate not bound -!missing-field! kSecAsn1SetOfIntegerTemplate not bound -!missing-field! kSecAsn1SetOfNullTemplate not bound -!missing-field! kSecAsn1SetOfObjectIDTemplate not bound -!missing-field! kSecAsn1SetOfOctetStringTemplate not bound -!missing-field! kSecAsn1SetOfPrintableStringTemplate not bound -!missing-field! kSecAsn1SetOfT61StringTemplate not bound -!missing-field! kSecAsn1SetOfTeletexStringTemplate not bound -!missing-field! kSecAsn1SetOfUniversalStringTemplate not bound -!missing-field! kSecAsn1SetOfUTCTimeTemplate not bound -!missing-field! kSecAsn1SetOfUTF8StringTemplate not bound -!missing-field! kSecAsn1SetOfVisibleStringTemplate not bound -!missing-field! kSecAsn1SkipTemplate not bound -!missing-field! kSecAsn1T61StringTemplate not bound -!missing-field! kSecAsn1TeletexStringTemplate not bound -!missing-field! kSecAsn1UniversalStringTemplate not bound -!missing-field! kSecAsn1UnsignedIntegerTemplate not bound -!missing-field! kSecAsn1UTCTimeTemplate not bound -!missing-field! kSecAsn1UTF8StringTemplate not bound -!missing-field! kSecAsn1VisibleStringTemplate not bound -!missing-field! kSecAttrAccess not bound -!missing-field! kSecAttrKeyType3DES not bound -!missing-field! kSecAttrKeyTypeAES not bound -!missing-field! kSecAttrKeyTypeCAST not bound -!missing-field! kSecAttrKeyTypeDES not bound -!missing-field! kSecAttrKeyTypeDSA not bound -!missing-field! kSecAttrKeyTypeECDSA not bound -!missing-field! kSecAttrKeyTypeRC2 not bound -!missing-field! kSecAttrKeyTypeRC4 not bound -!missing-field! kSecAttrPRF not bound -!missing-field! kSecAttrPRFHmacAlgSHA1 not bound -!missing-field! kSecAttrPRFHmacAlgSHA224 not bound -!missing-field! kSecAttrPRFHmacAlgSHA256 not bound -!missing-field! kSecAttrPRFHmacAlgSHA384 not bound -!missing-field! kSecAttrPRFHmacAlgSHA512 not bound -!missing-field! kSecAttrRounds not bound -!missing-field! kSecAttrSalt not bound -!missing-field! kSecCFErrorArchitecture not bound -!missing-field! kSecCFErrorGuestAttributes not bound -!missing-field! kSecCFErrorInfoPlist not bound -!missing-field! kSecCFErrorPath not bound -!missing-field! kSecCFErrorPattern not bound -!missing-field! kSecCFErrorRequirementSyntax not bound -!missing-field! kSecCFErrorResourceAdded not bound -!missing-field! kSecCFErrorResourceAltered not bound -!missing-field! kSecCFErrorResourceMissing not bound -!missing-field! kSecCFErrorResourceSeal not bound -!missing-field! kSecCFErrorResourceSideband not bound -!missing-field! kSecCodeAttributeArchitecture not bound -!missing-field! kSecCodeAttributeBundleVersion not bound -!missing-field! kSecCodeAttributeSubarchitecture not bound -!missing-field! kSecCodeAttributeUniversalFileOffset not bound -!missing-field! kSecCodeInfoCdHashes not bound -!missing-field! kSecCodeInfoCertificates not bound -!missing-field! kSecCodeInfoChangedFiles not bound -!missing-field! kSecCodeInfoCMS not bound -!missing-field! kSecCodeInfoDesignatedRequirement not bound -!missing-field! kSecCodeInfoDigestAlgorithm not bound -!missing-field! kSecCodeInfoDigestAlgorithms not bound -!missing-field! kSecCodeInfoEntitlements not bound -!missing-field! kSecCodeInfoEntitlementsDict not bound -!missing-field! kSecCodeInfoFlags not bound -!missing-field! kSecCodeInfoFormat not bound -!missing-field! kSecCodeInfoIdentifier not bound -!missing-field! kSecCodeInfoImplicitDesignatedRequirement not bound -!missing-field! kSecCodeInfoMainExecutable not bound -!missing-field! kSecCodeInfoPlatformIdentifier not bound -!missing-field! kSecCodeInfoPList not bound -!missing-field! kSecCodeInfoRequirementData not bound -!missing-field! kSecCodeInfoRequirements not bound -!missing-field! kSecCodeInfoRuntimeVersion not bound -!missing-field! kSecCodeInfoSource not bound -!missing-field! kSecCodeInfoStatus not bound -!missing-field! kSecCodeInfoTeamIdentifier not bound -!missing-field! kSecCodeInfoTime not bound -!missing-field! kSecCodeInfoTimestamp not bound -!missing-field! kSecCodeInfoTrust not bound -!missing-field! kSecCodeInfoUnique not bound -!missing-field! kSecGuestAttributeArchitecture not bound -!missing-field! kSecGuestAttributeAudit not bound -!missing-field! kSecGuestAttributeCanonical not bound -!missing-field! kSecGuestAttributeDynamicCode not bound -!missing-field! kSecGuestAttributeDynamicCodeInfoPlist not bound -!missing-field! kSecGuestAttributeHash not bound -!missing-field! kSecGuestAttributeMachPort not bound -!missing-field! kSecGuestAttributePid not bound -!missing-field! kSecGuestAttributeSubarchitecture not bound -!missing-field! kSecImportExportAccess not bound -!missing-field! kSecImportExportKeychain not bound -!missing-field! kSecMatchDiacriticInsensitive not bound -!missing-field! kSecMatchSubjectEndsWith not bound -!missing-field! kSecMatchSubjectStartsWith not bound -!missing-field! kSecMatchSubjectWholeString not bound -!missing-field! kSecMatchWidthInsensitive not bound -!missing-field! kSecPolicyApplePKINITClient not bound -!missing-field! kSecPolicyApplePKINITServer not bound -!missing-field! kSecUseKeychain not bound -!missing-pinvoke! AuthorizationCopyInfo is not bound -!missing-pinvoke! AuthorizationCopyPrivilegedReference is not bound -!missing-pinvoke! AuthorizationCopyRights is not bound -!missing-pinvoke! AuthorizationCopyRightsAsync is not bound -!missing-pinvoke! AuthorizationCreate is not bound -!missing-pinvoke! AuthorizationCreateFromExternalForm is not bound -!missing-pinvoke! AuthorizationExecuteWithPrivileges is not bound -!missing-pinvoke! AuthorizationFree is not bound -!missing-pinvoke! AuthorizationFreeItemSet is not bound -!missing-pinvoke! AuthorizationMakeExternalForm is not bound -!missing-pinvoke! AuthorizationPluginCreate is not bound -!missing-pinvoke! sec_protocol_options_set_peer_authentication_optional is not bound -!missing-pinvoke! SecAsn1AllocCopy is not bound -!missing-pinvoke! SecAsn1AllocCopyItem is not bound -!missing-pinvoke! SecAsn1AllocItem is not bound -!missing-pinvoke! SecAsn1CoderCreate is not bound -!missing-pinvoke! SecAsn1CoderRelease is not bound -!missing-pinvoke! SecAsn1Decode is not bound -!missing-pinvoke! SecAsn1DecodeData is not bound -!missing-pinvoke! SecAsn1EncodeItem is not bound -!missing-pinvoke! SecAsn1Malloc is not bound -!missing-pinvoke! SecAsn1OidCompare is not bound -!missing-pinvoke! SecCodeCheckValidity is not bound -!missing-pinvoke! SecCodeCheckValidityWithErrors is not bound -!missing-pinvoke! SecCodeCopyDesignatedRequirement is not bound -!missing-pinvoke! SecCodeCopyHost is not bound -!missing-pinvoke! SecCodeCopyPath is not bound -!missing-pinvoke! SecCodeCopySelf is not bound -!missing-pinvoke! SecCodeCopySigningInformation is not bound -!missing-pinvoke! SecCodeCopyStaticCode is not bound -!missing-pinvoke! SecCodeGetTypeID is not bound -!missing-pinvoke! SecCodeMapMemory is not bound -!missing-pinvoke! SecRequirementCopyData is not bound -!missing-pinvoke! SecRequirementCopyString is not bound -!missing-pinvoke! SecRequirementCreateWithData is not bound -!missing-pinvoke! SecRequirementCreateWithString is not bound -!missing-pinvoke! SecRequirementCreateWithStringAndErrors is not bound -!missing-pinvoke! SecRequirementGetTypeID is not bound -!missing-pinvoke! SecStaticCodeCheckValidity is not bound -!missing-pinvoke! SecStaticCodeCheckValidityWithErrors is not bound -!missing-pinvoke! SecStaticCodeCreateWithPath is not bound -!missing-pinvoke! SecStaticCodeCreateWithPathAndAttributes is not bound -!missing-pinvoke! SecStaticCodeGetTypeID is not bound -!missing-pinvoke! SecureDownloadCopyCreationDate is not bound -!missing-pinvoke! SecureDownloadCopyName is not bound -!missing-pinvoke! SecureDownloadCopyTicketLocation is not bound -!missing-pinvoke! SecureDownloadCopyURLs is not bound -!missing-pinvoke! SecureDownloadCreateWithTicket is not bound -!missing-pinvoke! SecureDownloadFinished is not bound -!missing-pinvoke! SecureDownloadGetDownloadSize is not bound -!missing-pinvoke! SecureDownloadRelease is not bound -!missing-pinvoke! SecureDownloadUpdateWithData is not bound -!missing-pinvoke! SessionCreate is not bound -!missing-pinvoke! SessionGetInfo is not bound -!missing-pinvoke! sec_protocol_options_get_enable_encrypted_client_hello is not bound -!missing-pinvoke! sec_protocol_options_set_enable_encrypted_client_hello is not bound -## appended from unclassified file -!missing-pinvoke! sec_protocol_options_get_quic_use_legacy_codepoint is not bound -!missing-pinvoke! sec_protocol_options_set_quic_use_legacy_codepoint is not bound -!missing-pinvoke! SecTrustCopyCertificateChain is not bound diff --git a/tests/xtro-sharpie/iOS-Security.todo b/tests/xtro-sharpie/iOS-Security.todo deleted file mode 100644 index e4fa6f23e56c..000000000000 --- a/tests/xtro-sharpie/iOS-Security.todo +++ /dev/null @@ -1,7 +0,0 @@ -!deprecated-attribute-missing! SecKeyDecrypt missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyEncrypt missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyGeneratePair missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyRawSign missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyRawVerify missing a [Deprecated] attribute -!deprecated-attribute-missing! SecTrustGetCertificateAtIndex missing a [Deprecated] attribute -!missing-pinvoke! SecTrustCopyCertificateChain is not bound diff --git a/tests/xtro-sharpie/macOS-Security.todo b/tests/xtro-sharpie/macOS-Security.todo deleted file mode 100644 index 93110ca2edca..000000000000 --- a/tests/xtro-sharpie/macOS-Security.todo +++ /dev/null @@ -1 +0,0 @@ -!missing-pinvoke! SecTrustCopyCertificateChain is not bound diff --git a/tests/xtro-sharpie/tvOS-Security.todo b/tests/xtro-sharpie/tvOS-Security.todo deleted file mode 100644 index e4fa6f23e56c..000000000000 --- a/tests/xtro-sharpie/tvOS-Security.todo +++ /dev/null @@ -1,7 +0,0 @@ -!deprecated-attribute-missing! SecKeyDecrypt missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyEncrypt missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyGeneratePair missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyRawSign missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyRawVerify missing a [Deprecated] attribute -!deprecated-attribute-missing! SecTrustGetCertificateAtIndex missing a [Deprecated] attribute -!missing-pinvoke! SecTrustCopyCertificateChain is not bound diff --git a/tests/xtro-sharpie/watchOS-Security.todo b/tests/xtro-sharpie/watchOS-Security.todo deleted file mode 100644 index e4fa6f23e56c..000000000000 --- a/tests/xtro-sharpie/watchOS-Security.todo +++ /dev/null @@ -1,7 +0,0 @@ -!deprecated-attribute-missing! SecKeyDecrypt missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyEncrypt missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyGeneratePair missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyRawSign missing a [Deprecated] attribute -!deprecated-attribute-missing! SecKeyRawVerify missing a [Deprecated] attribute -!deprecated-attribute-missing! SecTrustGetCertificateAtIndex missing a [Deprecated] attribute -!missing-pinvoke! SecTrustCopyCertificateChain is not bound From e2f0381e9cff0d0d978c191764fd6a39d6c1c7d9 Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Fri, 6 Aug 2021 17:53:49 -0400 Subject: [PATCH 2/3] Address reviews about deprecation. --- src/Security/Authorization.cs | 3 + src/Security/Certificate.cs | 156 +++++++++++++++++++++++++++++++++- src/Security/Trust.cs | 42 ++++++++- 3 files changed, 195 insertions(+), 6 deletions(-) diff --git a/src/Security/Authorization.cs b/src/Security/Authorization.cs index 87e66840ce7b..a4a16b5b1338 100644 --- a/src/Security/Authorization.cs +++ b/src/Security/Authorization.cs @@ -31,6 +31,9 @@ using Foundation; using System; using System.Runtime.InteropServices; +#if NET +using System.Runtime.Versioning; +#endif namespace Security { diff --git a/src/Security/Certificate.cs b/src/Security/Certificate.cs index 8645a81bf698..ae988788cba6 100644 --- a/src/Security/Certificate.cs +++ b/src/Security/Certificate.cs @@ -30,6 +30,8 @@ #if !NET #define NATIVE_APPLE_CERTIFICATE +#else +using System.Runtime.Versioning; #endif using System; @@ -551,19 +553,53 @@ public SecKey (IntPtr handle, bool owns) [DllImport (Constants.SecurityLibrary, EntryPoint="SecKeyGetTypeID")] public extern static nint GetTypeID (); +#if !NET [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyCreateRandomKey' instead.")] +#else + [UnsupportedOSPlatform ("macos12.0")] + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif MONOMAC + [Obsolete ("Starting with macos12.0 API removed, please use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyGeneratePair (IntPtr dictHandle, out IntPtr pubKey, out IntPtr privKey); // TODO: pull all the TypeRefs needed for the NSDictionary +#if !NET [Deprecated (PlatformName.MacOSX, 12, 0, message: "Use 'CreateRandomKey' instead.")] [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CreateRandomKey' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CreateRandomKey' instead.")] [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CreateRandomKey' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CreateRandomKey' instead.")] +#else + [UnsupportedOSPlatform ("macos12.0")] + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif MONOMAC + [Obsolete ("Starting with macos12.0 API removed, please use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif public static SecStatusCode GenerateKeyPair (NSDictionary parameters, out SecKey publicKey, out SecKey privateKey) { if (parameters == null) @@ -633,15 +669,43 @@ public int BlockSize { } } +#if !NET [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateSignature' instead.")] - [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateSignature' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'SecKeyCreateSignature' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateSignature' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyCreateSignature' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyCreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyCreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyCreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyRawSign (IntPtr handle, SecPadding padding, IntPtr dataToSign, nint dataToSignLen, IntPtr sig, ref nint sigLen); +#if !NET [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CreateSignature' instead.")] - [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CreateSignature' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CreateSignature' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CreateSignature' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CreateSignature' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'CreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'CreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'CreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif public SecStatusCode RawSign (SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) { if (handle == IntPtr.Zero) @@ -675,15 +739,43 @@ unsafe SecStatusCode _RawSign (SecPadding padding, IntPtr dataToSign, int dataTo return status; } +#if !NET [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyVerifySignature' instead.")] - [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyVerifySignature' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'SecKeyVerifySignature' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyVerifySignature' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyVerifySignature' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyVerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyVerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyVerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyRawVerify (IntPtr handle, SecPadding padding, IntPtr signedData, nint signedLen, IntPtr sign, nint signLen); +#if !NET [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'VerifySignature' instead.")] - [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'VerifySignature' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'VerifySignature' instead.")] + [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'VerifySignature' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'VerifySignature' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'VerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'VerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'VerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif public unsafe SecStatusCode RawVerify (SecPadding padding, IntPtr signedData, int signedDataLen, IntPtr signature, int signatureLen) { if (handle == IntPtr.Zero) @@ -714,15 +806,43 @@ public SecStatusCode RawVerify (SecPadding padding, byte [] signedData, byte [] } } +#if !NET [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateEncryptedData' instead.")] [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateEncryptedData' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'SecKeyCreateEncryptedData' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyCreateEncryptedData' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyCreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyCreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyCreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyEncrypt (IntPtr handle, SecPadding padding, IntPtr plainText, nint plainTextLen, IntPtr cipherText, ref nint cipherTextLengh); +#if !NET [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CreateEncryptedData' instead.")] [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CreateEncryptedData' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CreateEncryptedData' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CreateEncryptedData' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'CreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'CreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'CreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif public unsafe SecStatusCode Encrypt (SecPadding padding, IntPtr plainText, nint plainTextLen, IntPtr cipherText, ref nint cipherTextLen) { if (handle == IntPtr.Zero) @@ -755,15 +875,43 @@ public SecStatusCode Encrypt (SecPadding padding, byte [] plainText, out byte [] return Encrypt (padding, plainText, cipherText); } +#if !NET [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'SecKeyCreateDecryptedData' instead.")] [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'SecKeyCreateDecryptedData' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'SecKeyCreateDecryptedData' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'SecKeyCreateDecryptedData' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyCreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyCreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyCreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif [DllImport (Constants.SecurityLibrary)] extern static SecStatusCode SecKeyDecrypt (IntPtr handle, SecPadding padding, IntPtr cipherTextLen, nint cipherLen, IntPtr plainText, ref nint plainTextLen); +#if !NET [Deprecated (PlatformName.iOS, 15, 0, message: "Use 'CreateDecryptedData' instead.")] [Deprecated (PlatformName.TvOS, 15, 0, message: "Use 'CreateDecryptedData' instead.")] + [Deprecated (PlatformName.MacCatalyst, 15, 0, message: "Use 'CreateDecryptedData' instead.")] [Deprecated (PlatformName.WatchOS, 8, 0, message: "Use 'CreateDecryptedData' instead.")] +#else + [UnsupportedOSPlatform ("ios15.0")] + [UnsupportedOSPlatform ("tvos15.0")] + [UnsupportedOSPlatform ("maccatalyst15.0")] +#if __MACCATALYST__ + [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'CreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please use 'CreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please use 'CreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif public unsafe SecStatusCode Decrypt (SecPadding padding, IntPtr cipherText, nint cipherTextLen, IntPtr plainText, ref nint plainTextLen) { if (handle == IntPtr.Zero) diff --git a/src/Security/Trust.cs b/src/Security/Trust.cs index d188c428df89..a21e113c78ff 100644 --- a/src/Security/Trust.cs +++ b/src/Security/Trust.cs @@ -34,6 +34,9 @@ using ObjCRuntime; using CoreFoundation; using Foundation; +#if NET +using System.Runtime.Versioning; +#endif namespace Security { public partial class SecTrust : INativeObject, IDisposable { @@ -159,17 +162,52 @@ public int Count { } } +#if !NET [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 [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 API removed, please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif IOS + [Obsolete ("Starting with ios15.0 API removed, please please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif TVOS + [Obsolete ("Starting with tvos15.0 API removed, please please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#elif MONOMAC + [Obsolete ("Starting with macos12.0 API removed, please please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] +#endif +#endif public SecCertificate this [nint index] { get { if (handle == IntPtr.Zero) @@ -185,7 +223,7 @@ public SecCertificate this [nint index] { [SupportedOSPlatform ("ios15.0")] [SupportedOSPlatform ("tvos15.0")] [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("macos12.0") + [SupportedOSPlatform ("macos12.0")] #else [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #endif @@ -196,7 +234,7 @@ public SecCertificate this [nint index] { [SupportedOSPlatform ("ios15.0")] [SupportedOSPlatform ("tvos15.0")] [SupportedOSPlatform ("maccatalyst15.0")] - [SupportedOSPlatform ("macos12.0") + [SupportedOSPlatform ("macos12.0")] #else [Watch (8,0), TV (15,0), Mac (12,0), iOS (15,0), MacCatalyst (15,0)] #endif From a1fb91737a8e17576f300b4b770335627d54985d Mon Sep 17 00:00:00 2001 From: Manuel de la Pena Date: Mon, 9 Aug 2021 10:50:50 -0400 Subject: [PATCH 3/3] Update deprecated messages. --- src/Security/Certificate.cs | 64 ++++++++++++++++++------------------- src/Security/Trust.cs | 8 ++--- 2 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/Security/Certificate.cs b/src/Security/Certificate.cs index ae988788cba6..3f9537eafbdf 100644 --- a/src/Security/Certificate.cs +++ b/src/Security/Certificate.cs @@ -565,13 +565,13 @@ public SecKey (IntPtr handle, bool owns) [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif MONOMAC - [Obsolete ("Starting with macos12.0 API removed, please use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with macos12.0 use 'SecKeyCreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif [DllImport (Constants.SecurityLibrary)] @@ -591,13 +591,13 @@ public SecKey (IntPtr handle, bool owns) [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif MONOMAC - [Obsolete ("Starting with macos12.0 API removed, please use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with macos12.0 use 'CreateRandomKey' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif public static SecStatusCode GenerateKeyPair (NSDictionary parameters, out SecKey publicKey, out SecKey privateKey) @@ -679,11 +679,11 @@ public int BlockSize { [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyCreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'SecKeyCreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyCreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'SecKeyCreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyCreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'SecKeyCreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif [DllImport (Constants.SecurityLibrary)] @@ -699,11 +699,11 @@ public int BlockSize { [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'CreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'CreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'CreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'CreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'CreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'CreateSignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif public SecStatusCode RawSign (SecPadding padding, IntPtr dataToSign, int dataToSignLen, out byte [] result) @@ -749,11 +749,11 @@ unsafe SecStatusCode _RawSign (SecPadding padding, IntPtr dataToSign, int dataTo [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyVerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'SecKeyVerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyVerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'SecKeyVerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyVerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'SecKeyVerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif [DllImport (Constants.SecurityLibrary)] @@ -769,11 +769,11 @@ unsafe SecStatusCode _RawSign (SecPadding padding, IntPtr dataToSign, int dataTo [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'VerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'VerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'VerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'VerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'VerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'VerifySignature' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif public unsafe SecStatusCode RawVerify (SecPadding padding, IntPtr signedData, int signedDataLen, IntPtr signature, int signatureLen) @@ -816,11 +816,11 @@ public SecStatusCode RawVerify (SecPadding padding, byte [] signedData, byte [] [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyCreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'SecKeyCreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyCreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'SecKeyCreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyCreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'SecKeyCreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif [DllImport (Constants.SecurityLibrary)] @@ -836,11 +836,11 @@ public SecStatusCode RawVerify (SecPadding padding, byte [] signedData, byte [] [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'CreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'CreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'CreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'CreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'CreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'CreateEncryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif public unsafe SecStatusCode Encrypt (SecPadding padding, IntPtr plainText, nint plainTextLen, IntPtr cipherText, ref nint cipherTextLen) @@ -885,11 +885,11 @@ public SecStatusCode Encrypt (SecPadding padding, byte [] plainText, out byte [] [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'SecKeyCreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'SecKeyCreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'SecKeyCreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'SecKeyCreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'SecKeyCreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'SecKeyCreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif [DllImport (Constants.SecurityLibrary)] @@ -905,11 +905,11 @@ public SecStatusCode Encrypt (SecPadding padding, byte [] plainText, out byte [] [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'CreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with maccatalyst15.0 use 'CreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif IOS - [Obsolete ("Starting with ios15.0 API removed, please use 'CreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with ios15.0 use 'CreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #elif TVOS - [Obsolete ("Starting with tvos15.0 API removed, please use 'CreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [Obsolete ("Starting with tvos15.0 use 'CreateDecryptedData' instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] #endif #endif public unsafe SecStatusCode Decrypt (SecPadding padding, IntPtr cipherText, nint cipherTextLen, IntPtr plainText, ref nint plainTextLen) diff --git a/src/Security/Trust.cs b/src/Security/Trust.cs index a21e113c78ff..fc255962c819 100644 --- a/src/Security/Trust.cs +++ b/src/Security/Trust.cs @@ -199,13 +199,13 @@ public int Count { [UnsupportedOSPlatform ("tvos15.0")] [UnsupportedOSPlatform ("maccatalyst15.0")] #if __MACCATALYST__ - [Obsolete ("Starting with maccatalyst15.0 API removed, please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [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 API removed, please please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [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 API removed, please please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [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 API removed, please please use 'GetCertificateChain' method instead.", DiagnosticId = "BI1234", UrlFormat = "https://github.com/xamarin/xamarin-macios/wiki/Obsolete")] + [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] {