2f8f9a1a815084a7a961602fa07bcf31e8bb126a
[platform/core/connectivity/smartcard-service.git] / common / include / PKCS15Object.h
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
18 #ifndef PKCS15OBJECT_H_
19 #define PKCS15OBJECT_H_
20
21 /* standard library header */
22 #include <map>
23 #include <vector>
24
25 /* SLP library header */
26
27 /* local header */
28 #include "FileObject.h"
29 #include "PKCS15Path.h"
30
31 using namespace std;
32
33 namespace smartcard_service_api
34 {
35         class PKCS15Object: public FileObject
36         {
37         protected:
38                 map<unsigned int, ByteArray> dataList;
39
40         public:
41                 /* TODO : encapsulate below to asn class */
42                 static const unsigned int TAG_SEQUENCE = (unsigned int)0x30;
43                 static const unsigned int TAG_OCTET_STREAM = (unsigned int)0x04;
44
45 //              PKCS15Object();
46                 PKCS15Object(Channel *channel);
47                 PKCS15Object(Channel *channel, ByteArray selectResponse);
48                 ~PKCS15Object();
49
50                 int decodePath(ByteArray path, PKCS15Path &result);
51                 int getPath(unsigned int type, PKCS15Path &result);
52                 int getPaths(vector<PKCS15Path> &paths);
53
54                 static ByteArray getOctetStream(const ByteArray &data);
55         };
56
57 } /* namespace smartcard_service_api */
58 #endif /* PKCS15OBJECT_H_ */