iOS Guides | Samples

Security.SecKeyChain.QueryAsConcreteType Method

Use this method to query the KeyChain and get back a SecCertificate, a SecKey or a SecIdentity.

Syntax

public static Object QueryAsConcreteType (SecRecord query, out SecStatusCode result)

Parameters

query
The query used to lookup the value on the keychain.
result
Returns the status code from calling SecItemCopyMatching.

Returns

An object that can be one of SecCertificate, a SecKey or a SecIdentity or null if there is no value found.

Remarks

This method will throw an exception if the KeyChain contains a new data type that you have introduced with a newer version of Xamarin.iOS into the keychain and you then try to use this with an older version that does not have the ability of decoding theve value.

This is the strongly typed equivalent of calling the Security's framework SecItemCopyMatching method with the kSecReturnRef set to true.

Requirements

Namespace: Security
Assembly: Xamarin.iOS (in Xamarin.iOS.dll)
Assembly Versions: 0.0.0.0