summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHyihong Chae <hh.chae@samsung.com>2017-07-04 20:10:24 +0900
committerHyihong Chae <hh.chae@samsung.com>2017-07-04 20:11:27 +0900
commita5a07ecfcc5315a16e7a61bc519f5ece67c9db5c (patch)
tree55697cbaaf752218e91b1ff77e5349284cb9db76
parentb6385839e8179ccfa051136dcecf67a70a17bce7 (diff)
downloadsmartcard-accepted/tizen_unified.tar.gz
smartcard-accepted/tizen_unified.tar.bz2
smartcard-accepted/tizen_unified.zip
Change-Id: I60681b13ef708187a23cc9bb2372a7e49879f1a6 Signed-off-by: HyiHong Chae <hh.chae@samsung.com>
-rw-r--r--Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs6
-rwxr-xr-xTizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs84
-rw-r--r--Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardReader.cs2
-rw-r--r--Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardSession.cs8
4 files changed, 56 insertions, 44 deletions
diff --git a/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs b/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs
index 8c96427..081823a 100644
--- a/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs
+++ b/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs
@@ -137,12 +137,14 @@ namespace Tizen.Network.Smartcard
}
//Free unmanaged objects
disposed = true;
- }
-
+ }
+
/// <summary>
/// Closes the given channel to 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.Channel.ChannelClose(_channelHandle);
diff --git a/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs b/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs
index d901ce3..a711be1 100755
--- a/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs
+++ b/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs
@@ -1,47 +1,47 @@
-/*
- * 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()
- {
+/*
+ * 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()
+ {
try
{
return SmartcardManagerImpl.Instance.GetReaders();
- }
- catch (TypeInitializationException e)
+ }
+ catch (TypeInitializationException e)
{
throw e.InnerException;
- }
- }
- }
-}
+ }
+ }
+ }
+}
diff --git a/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardReader.cs b/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardReader.cs
index eb943d9..2aa6f07 100644
--- a/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardReader.cs
+++ b/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardReader.cs
@@ -135,6 +135,8 @@ namespace Tizen.Network.Smartcard
/// Closes all the sessions opened on the given reader.
/// </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 CloseSessions()
{
int ret = Interop.Smartcard.Reader.ReaderCloseSessions(_readerHandle);
diff --git a/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardSession.cs b/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardSession.cs
index 9bae91e..107181e 100644
--- a/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardSession.cs
+++ b/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardSession.cs
@@ -154,6 +154,8 @@ namespace Tizen.Network.Smartcard
/// 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);
@@ -169,6 +171,8 @@ namespace Tizen.Network.Smartcard
/// 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);
@@ -196,6 +200,8 @@ namespace Tizen.Network.Smartcard
/// <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);
@@ -217,6 +223,8 @@ namespace Tizen.Network.Smartcard
/// <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);