-/*
- * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
- *
- * Licensed under the Apache License, Version 2.0 (the License);
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an AS IS BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-using System;
-using System.Collections.Generic;
-using System.Threading.Tasks;
-
-namespace Tizen.Network.Smartcard
-{
- /// <summary>
- /// A class for Smartcard management. It allows applications to use Smartcard service.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <privilege>http://tizen.org/privilege/secureelement</privilege>
- static public class SmartcardManager
- {
- /// <summary>
- /// Gets the list of available Secure Element readers.
- /// </summary>
- /// <since_tizen> 3 </since_tizen>
- /// <returns>List of SmartcardReader objects.</returns>
- static public IEnumerable<SmartcardReader> GetReaders()
- {
+/*\r
+ * Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved\r
+ *\r
+ * Licensed under the Apache License, Version 2.0 (the License);\r
+ * you may not use this file except in compliance with the License.\r
+ * You may obtain a copy of the License at\r
+ *\r
+ * http://www.apache.org/licenses/LICENSE-2.0\r
+ *\r
+ * Unless required by applicable law or agreed to in writing, software\r
+ * distributed under the License is distributed on an AS IS BASIS,\r
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ * See the License for the specific language governing permissions and\r
+ * limitations under the License.\r
+ */\r
+\r
+using System;\r
+using System.Collections.Generic;\r
+using System.Threading.Tasks;\r
+\r
+namespace Tizen.Network.Smartcard\r
+{\r
+ /// <summary>\r
+ /// A class for Smartcard management. It allows applications to use Smartcard service.\r
+ /// </summary>\r
+ /// <since_tizen> 3 </since_tizen>\r
+ /// <privilege>http://tizen.org/privilege/secureelement</privilege>\r
+ static public class SmartcardManager\r
+ {\r
+ /// <summary>\r
+ /// Gets the list of available Secure Element readers.\r
+ /// </summary>\r
+ /// <since_tizen> 3 </since_tizen>\r
+ /// <returns>List of SmartcardReader objects.</returns>\r
+ static public IEnumerable<SmartcardReader> GetReaders()\r
+ {\r
try\r
{\r
return SmartcardManagerImpl.Instance.GetReaders();\r
- }
- catch (TypeInitializationException e)
+ }\r
+ catch (TypeInitializationException e)\r
{\r
throw e.InnerException;\r
- }
- }
- }
-}
+ }\r
+ }\r
+ }\r
+}\r
/// Closes the connection with the Secure Element.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Smartcard is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void Close()
{
int ret = Interop.Smartcard.Session.SessionClose(_sessionHandle);
/// Closes any channel opened on the given session.
/// </summary>
/// <since_tizen> 3 </since_tizen>
+ /// <exception cref="NotSupportedException">Thrown when Smartcard is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public void CloseChannels()
{
int ret = Interop.Smartcard.Session.SessionCloseChannels(_sessionHandle);
/// <returns>The SmartcardChannel object for basic channel.</returns>
/// <param name="aid">Byte array containing the Application ID(AID) to be selected on the given channel.</param>
/// <param name="p2">P2 byte of the SELECT command if executed.</param>
+ /// <exception cref="NotSupportedException">Thrown when Smartcard is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public SmartcardChannel OpenBasicChannel(byte[] aid, byte p2)
{
int ret = Interop.Smartcard.Session.SessionOpenBasicChannel(_sessionHandle, aid, aid.Length, p2, out _basicChannel);
/// <returns>The SmartcardChannel object for logical channel.</returns>
/// <param name="aid">Byte array containing the Application ID(AID) to be selected on the given channel.</param>
/// <param name="p2">P2 byte of the SELECT command if executed.</param>
+ /// <exception cref="NotSupportedException">Thrown when Smartcard is not supported.</exception>
+ /// <exception cref="InvalidOperationException">Thrown when the method failed due to invalid operation.</exception>
public SmartcardChannel OpenLogicalChannel(byte[] aid, byte p2)
{
int ret = Interop.Smartcard.Session.SessionOpenLogicalChannel(_sessionHandle, aid, aid.Length, p2, out _logicalChannel);