<Type Name="SecKeyChain" FullName="MonoMac.Security.SecKeyChain">
  <TypeSignature Language="C#" Value="public static class SecKeyChain" />
  <TypeSignature Language="ILAsm" Value=".class public auto ansi abstract sealed beforefieldinit SecKeyChain extends System.Object" />
  <AssemblyInfo>
    <AssemblyName>MonoMac</AssemblyName>
    <AssemblyVersion>0.0.0.0</AssemblyVersion>
  </AssemblyInfo>
  <Base>
    <BaseTypeName>System.Object</BaseTypeName>
  </Base>
  <Interfaces />
  <Docs>
    <summary>Access to the operating system keychain.</summary>
    <remarks>
      <para>
    This class provides both basic and advanced means to manipulate iOS or MacOS keychain.
    Majority Mac OS X keychain scenarios involve adding or looking up the stored password.
	AddInternetPassword and FindInternetPassword provide high-level API to accomplish this for Internet passwords.
	For generic passwords, the AddGenericPassword and FindInternetPassword perform the same task.
	Other methods of this class may be used for iOS or more advanced MacOS keychain scenarios.
			</para>
      <example>
        <code lang="C#">
var password = Encoding.UTF8.GetBytes("pA$$w0rd");
SecKeyChain.AddInternetPassword("bugzilla.novell.com", "miguel", password);

      	</code>
      </example>
      <example>
        <code lang="C#">
byte[] password = null;
var code = SecKeyChain.FindInternetPassword("bugzilla.novell.com", "miguel", out password);
if (code == SecStatusCode.Success) {
	var passwordString = Encoding.UTF8.GetString(password);
	Console.WriteLine("The password for the account is: {0}", passwordString);
}

      	</code>
      </example>
      <example>
        <code lang="C#">
var query = new SecRecord (SecKind.InternetPassword) {
   Sever = "bugzilla.novell.com",
   Account = "miguel"
};
var password = SecKeyChain.QueryAsData (query);
Console.WriteLine ("The password for the account is: {0}", password);

  			</code>
      </example>
    </remarks>
  </Docs>
  <Members>
    <Member MemberName="Add">
      <MemberSignature Language="C#" Value="public static MonoMac.Security.SecStatusCode Add (MonoMac.Security.SecRecord record);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype MonoMac.Security.SecStatusCode Add(class MonoMac.Security.SecRecord record) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Security.SecStatusCode</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="record" Type="MonoMac.Security.SecRecord" />
      </Parameters>
      <Docs>
        <param name="record">A populated record.</param>
        <summary>Adds the specified record to the keychain.</summary>
        <returns>The result of the operation.</returns>
        <remarks />
      </Docs>
    </Member>
    <Member MemberName="AddGenericPassword">
      <MemberSignature Language="C#" Value="public static MonoMac.Security.SecStatusCode AddGenericPassword (string serviceName, string accountName, byte[] password);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype MonoMac.Security.SecStatusCode AddGenericPassword(string serviceName, string accountName, unsigned int8[] password) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Security.SecStatusCode</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="serviceName" Type="System.String" />
        <Parameter Name="accountName" Type="System.String" />
        <Parameter Name="password" Type="System.Byte[]" />
      </Parameters>
      <Docs>
        <param name="serviceName">The name of the service for the generic password.</param>
        <param name="accountName">The name of the account for the generic password.</param>
        <param name="password">Array of bytes representing the password.</param>
        <summary>
        The method allows to add a new generic password to the default keychain (MacOS only).
        </summary>
        <returns>If the method succeeds, SecStatusCode.Success is returned. Otherwise the return value indicates the reason for the failure.</returns>
        <remarks>
        	This method can be used to add passwords to the default MacOS keychain for the various types of accounts other than the Internet: databases, network shares and so on.
					If the password with the given serviceName or accountName already exist in the default keychain, the method will fail with the SecStatusCode.DuplicateItem return value.
					To update existing password, use SecKeyChain.Update.
					This method will cause the Unlock Keychain dialog box to be displayed, if the default keychain is currently locked.
					This method is not available for iOS.
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="AddInternetPassword">
      <MemberSignature Language="C#" Value="public static MonoMac.Security.SecStatusCode AddInternetPassword (string serverName, string accountName, byte[] password, MonoMac.Security.SecProtocol protocolType = MonoMac.Security.SecProtocol.Http, short port = 0, string path = null, MonoMac.Security.SecAuthenticationType authenticationType = MonoMac.Security.SecAuthenticationType.Default, string securityDomain = null);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype MonoMac.Security.SecStatusCode AddInternetPassword(string serverName, string accountName, unsigned int8[] password, valuetype MonoMac.Security.SecProtocol protocolType, int16 port, string path, valuetype MonoMac.Security.SecAuthenticationType authenticationType, string securityDomain) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Security.SecStatusCode</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="serverName" Type="System.String" />
        <Parameter Name="accountName" Type="System.String" />
        <Parameter Name="password" Type="System.Byte[]" />
        <Parameter Name="protocolType" Type="MonoMac.Security.SecProtocol" />
        <Parameter Name="port" Type="System.Int16" />
        <Parameter Name="path" Type="System.String" />
        <Parameter Name="authenticationType" Type="MonoMac.Security.SecAuthenticationType" />
        <Parameter Name="securityDomain" Type="System.String" />
      </Parameters>
      <Docs>
        <param name="serverName">The server name for the Internet password.</param>
        <param name="accountName">The account name for the Internet password.</param>
        <param name="password">Array of bytes representing the password.</param>
        <param name="protocolType">Optional network protocol associated with the Internet password. If not provided, defaults to SecProtocol.Http.</param>
        <param name="port">Optional TCP/IP port associated with the Internet password. If not provided, defaults to 0.</param>
        <param name="path">Optional string which represents the path for the Internet password. If not provided, defaults to null.</param>
        <param name="authenticationType">Optional authentication type for the Internet password. If not provided, defaults to SecAuthenticationType.Default.</param>
        <param name="securityDomain">Optional security domain, if the protocol requires it. If not provided, defaults to null.</param>
        <summary>
        This method allows to add a new Internet password to the default keychain (MacOS only).
        </summary>
        <returns>If the method succeeds, SecStatusCode.Success is returned. Otherwise the return value indicates the reason for the failure.</returns>
        <remarks>
        	This method can be used to add passwords to the default MacOS keychain for the Internet accounts. For any other types of accounts, use SecKeyChain.AddGenericPassword.
					If the password with the given serviceName or accountName already exist in the default keychain, the method will fail with the SecStatusCode.DuplicateItem return value.
					To update existing password, use SecKeyChain.Update.
					This method will cause the Unlock Keychain dialog box to be displayed, if the default keychain is currently locked.
					This method is not available for iOS.
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="FindGenericPassword">
      <MemberSignature Language="C#" Value="public static MonoMac.Security.SecStatusCode FindGenericPassword (string serviceName, string accountName, out byte[] password);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype MonoMac.Security.SecStatusCode FindGenericPassword(string serviceName, string accountName, unsigned int8[] password) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Security.SecStatusCode</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="serviceName" Type="System.String" />
        <Parameter Name="accountName" Type="System.String" />
        <Parameter Name="password" Type="System.Byte[]&amp;" RefType="out" />
      </Parameters>
      <Docs>
        <param name="serviceName">The name of the service for generic password.</param>
        <param name="accountName">The account name of the service for generic password.</param>
        <param name="password">If the method succeeds, the byte array representing the password.</param>
        <summary>This method looks up for a generic password in the default keychain (MacOS only).</summary>
        <returns>If the method succeeds, SecStatusCode.Success is returned. Otherwise the return value indicates the reason for the failure.</returns>
        <remarks>
	        This method can be used to lookup for the password in the default MacOS keychain for accounts other than Internet.
					Both serviceName and accountName are optional and will accept nulls. Provide as many as needed to narrow the search sufficiently for your application.
					If multiple matching passwords exist, the first one will be returned.
					This method will cause the Unlock Keychain dialog box to be displayed, if the default keychain is currently locked.
					This method is not available for iOS.
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="FindInternetPassword">
      <MemberSignature Language="C#" Value="public static MonoMac.Security.SecStatusCode FindInternetPassword (string serverName, string accountName, out byte[] password, MonoMac.Security.SecProtocol protocolType = MonoMac.Security.SecProtocol.Http, short port = 0, string path = null, MonoMac.Security.SecAuthenticationType authenticationType = MonoMac.Security.SecAuthenticationType.Default, string securityDomain = null);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype MonoMac.Security.SecStatusCode FindInternetPassword(string serverName, string accountName, unsigned int8[] password, valuetype MonoMac.Security.SecProtocol protocolType, int16 port, string path, valuetype MonoMac.Security.SecAuthenticationType authenticationType, string securityDomain) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Security.SecStatusCode</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="serverName" Type="System.String" />
        <Parameter Name="accountName" Type="System.String" />
        <Parameter Name="password" Type="System.Byte[]&amp;" RefType="out" />
        <Parameter Name="protocolType" Type="MonoMac.Security.SecProtocol" />
        <Parameter Name="port" Type="System.Int16" />
        <Parameter Name="path" Type="System.String" />
        <Parameter Name="authenticationType" Type="MonoMac.Security.SecAuthenticationType" />
        <Parameter Name="securityDomain" Type="System.String" />
      </Parameters>
      <Docs>
        <param name="serverName">The server name for the Internet password.</param>
        <param name="accountName">The account name for the internet password.</param>
        <param name="password">If the method succeeds, the byte array representing the password.</param>
        <param name="protocolType">Optional network protocol associated with the Internet password. If not provided, defaults to SecProtocol.Http.</param>
        <param name="port">Optional TCP/IP port associated with the Internet password. If not provided, defaults to 0.</param>
        <param name="path">Optional string which represents the path for the Internet password. If not provided, defaults to null.</param>
        <param name="authenticationType">Optional authentication type for the Internet password. If not provided, defaults to SecAuthenticationType.Default.</param>
        <param name="securityDomain">Optional security domain, if the protocol requires it. If not provided, defaults to null.</param>
        <summary>This method looks up for the password in the default MacOS keychain for Internet accounts.</summary>
        <returns>If the method succeeds, SecStatusCode.Success is returned. Otherwise the return value indicates the reason for the failure.</returns>
        <remarks>
	        This method can be used to lookup for the password in the default MacOS keychain for Internet accounts.
					Most of the parameters are optional and will accept null. Provide as many as needed to narrow the search sufficiently for your application.
					If multiple matching passwords exist, the first one will be returned.
					This method will cause the Unlock Keychain dialog box to be displayed, if the default keychain is currently locked.
					This method is not available for iOS.
        </remarks>
      </Docs>
    </Member>
    <Member MemberName="QueryAsData">
      <MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSData QueryAsData (MonoMac.Security.SecRecord query);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig class MonoMac.Foundation.NSData QueryAsData(class MonoMac.Security.SecRecord query) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Foundation.NSData</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="query" Type="MonoMac.Security.SecRecord" />
      </Parameters>
      <Docs>
        <param name="query">The query used to lookup the value on the keychain.</param>
        <summary>Fetches an NSData record from the Keychain.</summary>
        <returns>The NSData associated with the given query.</returns>
        <remarks />
      </Docs>
    </Member>
    <Member MemberName="QueryAsData">
      <MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSData[] QueryAsData (MonoMac.Security.SecRecord query, int max);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig class MonoMac.Foundation.NSData[] QueryAsData(class MonoMac.Security.SecRecord query, int32 max) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Foundation.NSData[]</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="query" Type="MonoMac.Security.SecRecord" />
        <Parameter Name="max" Type="System.Int32" />
      </Parameters>
      <Docs>
        <param name="query">To be added.</param>
        <param name="max">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="QueryAsData">
      <MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSData QueryAsData (MonoMac.Security.SecRecord query, bool wantPersistentReference, out MonoMac.Security.SecStatusCode status);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig class MonoMac.Foundation.NSData QueryAsData(class MonoMac.Security.SecRecord query, bool wantPersistentReference, valuetype MonoMac.Security.SecStatusCode status) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Foundation.NSData</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="query" Type="MonoMac.Security.SecRecord" />
        <Parameter Name="wantPersistentReference" Type="System.Boolean" />
        <Parameter Name="status" Type="MonoMac.Security.SecStatusCode&amp;" RefType="out" />
      </Parameters>
      <Docs>
        <param name="query">To be added.</param>
        <param name="wantPersistentReference">To be added.</param>
        <param name="status">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="QueryAsData">
      <MemberSignature Language="C#" Value="public static MonoMac.Foundation.NSData[] QueryAsData (MonoMac.Security.SecRecord query, bool wantPersistentReference, int max, out MonoMac.Security.SecStatusCode status);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig class MonoMac.Foundation.NSData[] QueryAsData(class MonoMac.Security.SecRecord query, bool wantPersistentReference, int32 max, valuetype MonoMac.Security.SecStatusCode status) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Foundation.NSData[]</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="query" Type="MonoMac.Security.SecRecord" />
        <Parameter Name="wantPersistentReference" Type="System.Boolean" />
        <Parameter Name="max" Type="System.Int32" />
        <Parameter Name="status" Type="MonoMac.Security.SecStatusCode&amp;" RefType="out" />
      </Parameters>
      <Docs>
        <param name="query">To be added.</param>
        <param name="wantPersistentReference">To be added.</param>
        <param name="max">To be added.</param>
        <param name="status">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="QueryAsRecord">
      <MemberSignature Language="C#" Value="public static MonoMac.Security.SecRecord QueryAsRecord (MonoMac.Security.SecRecord query, out MonoMac.Security.SecStatusCode result);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig class MonoMac.Security.SecRecord QueryAsRecord(class MonoMac.Security.SecRecord query, valuetype MonoMac.Security.SecStatusCode result) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Security.SecRecord</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="query" Type="MonoMac.Security.SecRecord" />
        <Parameter Name="result" Type="MonoMac.Security.SecStatusCode&amp;" RefType="out" />
      </Parameters>
      <Docs>
        <param name="query">To be added.</param>
        <param name="result">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="QueryAsRecord">
      <MemberSignature Language="C#" Value="public static MonoMac.Security.SecRecord[] QueryAsRecord (MonoMac.Security.SecRecord query, int max, out MonoMac.Security.SecStatusCode result);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig class MonoMac.Security.SecRecord[] QueryAsRecord(class MonoMac.Security.SecRecord query, int32 max, valuetype MonoMac.Security.SecStatusCode result) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Security.SecRecord[]</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="query" Type="MonoMac.Security.SecRecord" />
        <Parameter Name="max" Type="System.Int32" />
        <Parameter Name="result" Type="MonoMac.Security.SecStatusCode&amp;" RefType="out" />
      </Parameters>
      <Docs>
        <param name="query">To be added.</param>
        <param name="max">To be added.</param>
        <param name="result">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Remove">
      <MemberSignature Language="C#" Value="public static MonoMac.Security.SecStatusCode Remove (MonoMac.Security.SecRecord record);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype MonoMac.Security.SecStatusCode Remove(class MonoMac.Security.SecRecord record) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Security.SecStatusCode</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="record" Type="MonoMac.Security.SecRecord" />
      </Parameters>
      <Docs>
        <param name="record">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
    <Member MemberName="Update">
      <MemberSignature Language="C#" Value="public static MonoMac.Security.SecStatusCode Update (MonoMac.Security.SecRecord query, MonoMac.Security.SecRecord newAttributes);" />
      <MemberSignature Language="ILAsm" Value=".method public static hidebysig valuetype MonoMac.Security.SecStatusCode Update(class MonoMac.Security.SecRecord query, class MonoMac.Security.SecRecord newAttributes) cil managed" />
      <MemberType>Method</MemberType>
      <AssemblyInfo>
        <AssemblyVersion>0.0.0.0</AssemblyVersion>
      </AssemblyInfo>
      <ReturnValue>
        <ReturnType>MonoMac.Security.SecStatusCode</ReturnType>
      </ReturnValue>
      <Parameters>
        <Parameter Name="query" Type="MonoMac.Security.SecRecord" />
        <Parameter Name="newAttributes" Type="MonoMac.Security.SecRecord" />
      </Parameters>
      <Docs>
        <param name="query">To be added.</param>
        <param name="newAttributes">To be added.</param>
        <summary>To be added.</summary>
        <returns>To be added.</returns>
        <remarks>To be added.</remarks>
      </Docs>
    </Member>
  </Members>
</Type>
