blob: 6f7ff2d7a6ca9f8cbc0c61f59d1318e4455ba80d [file] [log] [blame]
Kenny Root60711792013-08-16 14:02:41 -07001/*
2 * Copyright (C) 2013 The Android Open Source Project
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 KEYSTORE_DEFAULTS_H_
19#define KEYSTORE_DEFAULTS_H_
20
21/*
22 * These must be kept in sync with
23 * frameworks/base/keystore/java/android/security/KeyPairGeneratorSpec.java
24 */
25
26/* DSA */
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +010027constexpr int32_t DSA_DEFAULT_KEY_SIZE = 1024;
28constexpr int32_t DSA_MIN_KEY_SIZE = 512;
29constexpr int32_t DSA_MAX_KEY_SIZE = 8192;
Kenny Root60711792013-08-16 14:02:41 -070030
31/* EC */
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +010032constexpr int32_t EC_DEFAULT_KEY_SIZE = 256;
33constexpr int32_t EC_MIN_KEY_SIZE = 192;
34constexpr int32_t EC_MAX_KEY_SIZE = 521;
Kenny Root60711792013-08-16 14:02:41 -070035
36/* RSA */
Janis Danisevskisc7a9fa22016-10-13 18:43:45 +010037constexpr int32_t RSA_DEFAULT_KEY_SIZE = 2048;
38constexpr int32_t RSA_DEFAULT_EXPONENT = 0x10001;
39constexpr int32_t RSA_MIN_KEY_SIZE = 512;
40constexpr int32_t RSA_MAX_KEY_SIZE = 8192;
Kenny Root60711792013-08-16 14:02:41 -070041
42#endif /* KEYSTORE_DEFAULTS_H_ */