blob: 8edb22c78a2ec6bfaea413cb521cb456d1b80a11 [file] [log] [blame]
Alexander Afanasyevc169a812014-05-20 20:37:29 -04001/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
Jeff Thompson7b79eb62013-09-12 18:48:29 -07002/**
Yingdi Yuae734272015-07-04 17:38:48 -07003 * Copyright (c) 2013-2016 Regents of the University of California.
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07004 *
5 * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
Alexander Afanasyevdfa52c42014-04-24 21:10:11 -07006 *
Alexander Afanasyevc169a812014-05-20 20:37:29 -04007 * ndn-cxx library is free software: you can redistribute it and/or modify it under the
8 * terms of the GNU Lesser General Public License as published by the Free Software
9 * Foundation, either version 3 of the License, or (at your option) any later version.
10 *
11 * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
12 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
13 * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
14 *
15 * You should have received copies of the GNU General Public License and GNU Lesser
16 * General Public License along with ndn-cxx, e.g., in COPYING.md file. If not, see
17 * <http://www.gnu.org/licenses/>.
18 *
19 * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
Jeff Thompson7b79eb62013-09-12 18:48:29 -070020 */
21
22#ifndef NDN_SECURITY_COMMON_HPP
Jeff Thompsone589c3f2013-10-12 17:30:50 -070023#define NDN_SECURITY_COMMON_HPP
Jeff Thompson7b79eb62013-09-12 18:48:29 -070024
Yingdi Yuae734272015-07-04 17:38:48 -070025#include "../common.hpp"
26
Jeff Thompson7b79eb62013-09-12 18:48:29 -070027namespace ndn {
28
Yingdi Yuae734272015-07-04 17:38:48 -070029namespace signed_interest {
Yingdi Yu0f5fb692014-06-10 12:07:28 -070030
Yingdi Yuae734272015-07-04 17:38:48 -070031const ssize_t POS_SIG_VALUE = -1;
32const ssize_t POS_SIG_INFO = -2;
33const ssize_t POS_RANDOM_VAL = -3;
34const ssize_t POS_TIMESTAMP = -4;
Yingdi Yu0f5fb692014-06-10 12:07:28 -070035
Yingdi Yuae734272015-07-04 17:38:48 -070036const size_t MIN_LENGTH = 4;
Yingdi Yu0f5fb692014-06-10 12:07:28 -070037
38} // namespace signed_interest
39
Jeff Thompson7b79eb62013-09-12 18:48:29 -070040enum KeyType {
Yingdi Yuae734272015-07-04 17:38:48 -070041 KEY_TYPE_NONE = 0,
42 /// @deprecated use KEY_TYPE_NONE
43 KEY_TYPE_NULL = KEY_TYPE_NONE,
44
45 KEY_TYPE_RSA = 1,
46 KEY_TYPE_ECDSA = 2,
47 KEY_TYPE_AES = 128
Jeff Thompson7b79eb62013-09-12 18:48:29 -070048};
49
50enum KeyClass {
Yingdi Yuae734272015-07-04 17:38:48 -070051 KEY_CLASS_NONE,
Jeff Thompson7b79eb62013-09-12 18:48:29 -070052 KEY_CLASS_PUBLIC,
53 KEY_CLASS_PRIVATE,
54 KEY_CLASS_SYMMETRIC
55};
Alexander Afanasyevb78bc4d2014-04-09 21:20:52 -070056
Jeff Thompson7b79eb62013-09-12 18:48:29 -070057enum DigestAlgorithm {
Yingdi Yuae734272015-07-04 17:38:48 -070058 DIGEST_ALGORITHM_NONE = 0,
59 DIGEST_ALGORITHM_SHA256 = 1
Jeff Thompson7b79eb62013-09-12 18:48:29 -070060};
61
62enum EncryptMode {
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070063 ENCRYPT_MODE_DEFAULT,
Alexander Afanasyevb78bc4d2014-04-09 21:20:52 -070064 ENCRYPT_MODE_CFB_AES
Jeff Thompson79a2d5d2013-09-27 14:32:23 -070065 // ENCRYPT_MODE_CBC_AES
Jeff Thompson7b79eb62013-09-12 18:48:29 -070066};
67
Yingdi Yu2e57a582014-02-20 23:34:43 -080068enum AclType {
Yingdi Yuae734272015-07-04 17:38:48 -070069 ACL_TYPE_NONE,
Yingdi Yu2e57a582014-02-20 23:34:43 -080070 ACL_TYPE_PUBLIC,
Alexander Afanasyevb78bc4d2014-04-09 21:20:52 -070071 ACL_TYPE_PRIVATE
Yingdi Yu2e57a582014-02-20 23:34:43 -080072};
73
Yingdi Yu0f5fb692014-06-10 12:07:28 -070074} // namespace ndn
Jeff Thompson7b79eb62013-09-12 18:48:29 -070075
Yingdi Yuae734272015-07-04 17:38:48 -070076#endif // NDN_SECURITY_COMMON_HPP