Add rule for 'All devices apps' when access rule is empty.
[platform/core/connectivity/smartcard-service.git] / common / PKCS15Path.cpp
1 /*
2  * Copyright (c) 2012, 2013 Samsung Electronics Co., Ltd.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17 #include "PKCS15Path.h"
18
19 namespace smartcard_service_api
20 {
21         PKCS15Path::PKCS15Path() : index(-1), length(0)
22         {
23         }
24
25         PKCS15Path::PKCS15Path(const ByteArray &data) : index(-1), length(0)
26         {
27                 parseData(data);
28         }
29
30         PKCS15Path::PKCS15Path(const ByteArray &path, int index) :
31                 path(path), index(index), length(0)
32         {
33         }
34
35         PKCS15Path::PKCS15Path(const unsigned char *path,
36                 size_t length, int index) :
37                 path(path, length), index(index), length(0)
38         {
39         }
40
41         PKCS15Path::~PKCS15Path()
42         {
43         }
44
45         bool PKCS15Path::parseData(const ByteArray &data)
46         {
47                 /* TODO */
48 //              SimpleTLV tlv(data);
49 //
50 //              if (tlv.decodeTLV() == true && tlv.getTag() == 0x30) /* SEQUENCE */
51 //              {
52 //                      /* get path */
53 //                      path = tlv.getOctetString();
54 //
55 //                      if (tlv.decodeTLV())
56 //              }
57                 return true;
58         }
59
60         int PKCS15Path::encode(ByteArray &result) const
61         {
62                 /* TODO */
63                 return 0;
64         }
65
66 } /* namespace smartcard_service_api */