1 /* 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 */ 27 constexpr int32_t DSA_DEFAULT_KEY_SIZE = 1024; 28 constexpr int32_t DSA_MIN_KEY_SIZE = 512; 29 constexpr int32_t DSA_MAX_KEY_SIZE = 8192; 30 31 /* EC */ 32 constexpr int32_t EC_DEFAULT_KEY_SIZE = 256; 33 constexpr int32_t EC_MIN_KEY_SIZE = 192; 34 constexpr int32_t EC_MAX_KEY_SIZE = 521; 35 36 /* RSA */ 37 constexpr int32_t RSA_DEFAULT_KEY_SIZE = 2048; 38 constexpr int32_t RSA_DEFAULT_EXPONENT = 0x10001; 39 constexpr int32_t RSA_MIN_KEY_SIZE = 512; 40 constexpr int32_t RSA_MAX_KEY_SIZE = 8192; 41 42 #endif /* KEYSTORE_DEFAULTS_H_ */ 43