Home
last modified time | relevance | path

Searched refs:KeymasterDefs (Results 1 – 25 of 29) sorted by relevance

12

/frameworks/base/keystore/java/android/security/keystore/
DKeymasterUtils.java24 import android.security.keymaster.KeymasterDefs;
37 case KeymasterDefs.KM_DIGEST_NONE: in getDigestOutputSizeBits()
39 case KeymasterDefs.KM_DIGEST_MD5: in getDigestOutputSizeBits()
41 case KeymasterDefs.KM_DIGEST_SHA1: in getDigestOutputSizeBits()
43 case KeymasterDefs.KM_DIGEST_SHA_2_224: in getDigestOutputSizeBits()
45 case KeymasterDefs.KM_DIGEST_SHA_2_256: in getDigestOutputSizeBits()
47 case KeymasterDefs.KM_DIGEST_SHA_2_384: in getDigestOutputSizeBits()
49 case KeymasterDefs.KM_DIGEST_SHA_2_512: in getDigestOutputSizeBits()
59 case KeymasterDefs.KM_MODE_ECB: in isKeymasterBlockModeIndCpaCompatibleWithSymmetricCrypto()
61 case KeymasterDefs.KM_MODE_CBC: in isKeymasterBlockModeIndCpaCompatibleWithSymmetricCrypto()
[all …]
DKeyProperties.java23 import android.security.keymaster.KeymasterDefs;
85 return KeymasterDefs.KM_PURPOSE_ENCRYPT; in toKeymaster()
87 return KeymasterDefs.KM_PURPOSE_DECRYPT; in toKeymaster()
89 return KeymasterDefs.KM_PURPOSE_SIGN; in toKeymaster()
91 return KeymasterDefs.KM_PURPOSE_VERIFY; in toKeymaster()
93 return KeymasterDefs.KM_PURPOSE_WRAP; in toKeymaster()
101 case KeymasterDefs.KM_PURPOSE_ENCRYPT: in fromKeymaster()
103 case KeymasterDefs.KM_PURPOSE_DECRYPT: in fromKeymaster()
105 case KeymasterDefs.KM_PURPOSE_SIGN: in fromKeymaster()
107 case KeymasterDefs.KM_PURPOSE_VERIFY: in fromKeymaster()
[all …]
DAndroidKeyStoreRSASignatureSpi.java21 import android.security.keymaster.KeymasterDefs;
35 super(keymasterDigest, KeymasterDefs.KM_PAD_RSA_PKCS1_1_5_SIGN); in PKCS1Padding()
47 super(KeymasterDefs.KM_DIGEST_NONE); in NONEWithPKCS1Padding()
53 super(KeymasterDefs.KM_DIGEST_MD5); in MD5WithPKCS1Padding()
59 super(KeymasterDefs.KM_DIGEST_SHA1); in SHA1WithPKCS1Padding()
65 super(KeymasterDefs.KM_DIGEST_SHA_2_224); in SHA224WithPKCS1Padding()
71 super(KeymasterDefs.KM_DIGEST_SHA_2_256); in SHA256WithPKCS1Padding()
77 super(KeymasterDefs.KM_DIGEST_SHA_2_384); in SHA384WithPKCS1Padding()
83 super(KeymasterDefs.KM_DIGEST_SHA_2_512); in SHA512WithPKCS1Padding()
91 super(keymasterDigest, KeymasterDefs.KM_PAD_RSA_PSS); in PSSPadding()
[all …]
DAndroidKeyStoreSecretKeyFactorySpi.java23 import android.security.keymaster.KeymasterDefs;
101 if (keyCharacteristics.hwEnforced.containsTag(KeymasterDefs.KM_TAG_ORIGIN)) { in getKeyInfo()
104 keyCharacteristics.hwEnforced.getEnum(KeymasterDefs.KM_TAG_ORIGIN, -1)); in getKeyInfo()
105 } else if (keyCharacteristics.swEnforced.containsTag(KeymasterDefs.KM_TAG_ORIGIN)) { in getKeyInfo()
108 keyCharacteristics.swEnforced.getEnum(KeymasterDefs.KM_TAG_ORIGIN, -1)); in getKeyInfo()
113 keyCharacteristics.getUnsignedInt(KeymasterDefs.KM_TAG_KEY_SIZE, -1); in getKeyInfo()
121 keyCharacteristics.getEnums(KeymasterDefs.KM_TAG_PURPOSE)); in getKeyInfo()
126 for (int keymasterPadding : keyCharacteristics.getEnums(KeymasterDefs.KM_TAG_PADDING)) { in getKeyInfo()
149 keyCharacteristics.getEnums(KeymasterDefs.KM_TAG_DIGEST)); in getKeyInfo()
151 keyCharacteristics.getEnums(KeymasterDefs.KM_TAG_BLOCK_MODE)); in getKeyInfo()
[all …]
DAndroidKeyStoreRSACipherSpi.java24 import android.security.keymaster.KeymasterDefs;
54 super(KeymasterDefs.KM_PAD_NONE); in NoPadding()
61 setKeymasterPurposeOverride(KeymasterDefs.KM_PURPOSE_SIGN); in adjustConfigForEncryptingWithPrivateKey()
108 super(KeymasterDefs.KM_PAD_RSA_PKCS1_1_5_ENCRYPT); in PKCS1Padding()
115 setKeymasterPurposeOverride(KeymasterDefs.KM_PURPOSE_SIGN); in adjustConfigForEncryptingWithPrivateKey()
116 setKeymasterPaddingOverride(KeymasterDefs.KM_PAD_RSA_PKCS1_1_5_SIGN); in adjustConfigForEncryptingWithPrivateKey()
169 super(KeymasterDefs.KM_PAD_RSA_OAEP); in OAEPWithMGF1Padding()
205 case KeymasterDefs.KM_DIGEST_SHA1: in initAlgorithmSpecificParameters()
206 case KeymasterDefs.KM_DIGEST_SHA_2_224: in initAlgorithmSpecificParameters()
207 case KeymasterDefs.KM_DIGEST_SHA_2_256: in initAlgorithmSpecificParameters()
[all …]
DAndroidKeyStoreKeyGeneratorSpi.java24 import android.security.keymaster.KeymasterDefs;
48 super(KeymasterDefs.KM_ALGORITHM_AES, 128); in AES()
65 super(KeymasterDefs.KM_ALGORITHM_3DES, 168); in DESede()
71 super(KeymasterDefs.KM_ALGORITHM_HMAC, in HmacBase()
79 super(KeymasterDefs.KM_DIGEST_SHA1); in HmacSHA1()
85 super(KeymasterDefs.KM_DIGEST_SHA_2_224); in HmacSHA224()
91 super(KeymasterDefs.KM_DIGEST_SHA_2_256); in HmacSHA256()
97 super(KeymasterDefs.KM_DIGEST_SHA_2_384); in HmacSHA384()
103 super(KeymasterDefs.KM_DIGEST_SHA_2_512); in HmacSHA512()
138 if ((mKeymasterAlgorithm == KeymasterDefs.KM_ALGORITHM_HMAC) && (mKeymasterDigest == -1)) { in AndroidKeyStoreKeyGeneratorSpi()
[all …]
DAndroidKeyStoreUnauthenticatedAESCipherSpi.java22 import android.security.keymaster.KeymasterDefs;
46 super(KeymasterDefs.KM_MODE_ECB, keymasterPadding, false); in ECB()
51 super(KeymasterDefs.KM_PAD_NONE); in NoPadding()
57 super(KeymasterDefs.KM_PAD_PKCS7); in PKCS7Padding()
64 super(KeymasterDefs.KM_MODE_CBC, keymasterPadding, true); in CBC()
69 super(KeymasterDefs.KM_PAD_NONE); in NoPadding()
75 super(KeymasterDefs.KM_PAD_PKCS7); in PKCS7Padding()
82 super(KeymasterDefs.KM_MODE_CTR, keymasterPadding, true); in CTR()
87 super(KeymasterDefs.KM_PAD_NONE); in NoPadding()
249 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_ALGORITHM, KeymasterDefs.KM_ALGORITHM_AES); in addAlgorithmSpecificParametersToBegin()
[all …]
DAndroidKeyStoreSpi.java26 import android.security.keymaster.KeymasterDefs;
471 importArgs.addEnum(KeymasterDefs.KM_TAG_ALGORITHM, in setPrivateKeyEntry()
475 importArgs.addEnums(KeymasterDefs.KM_TAG_PURPOSE, in setPrivateKeyEntry()
478 importArgs.addEnums(KeymasterDefs.KM_TAG_DIGEST, in setPrivateKeyEntry()
482 importArgs.addEnums(KeymasterDefs.KM_TAG_BLOCK_MODE, in setPrivateKeyEntry()
502 importArgs.addEnums(KeymasterDefs.KM_TAG_PADDING, keymasterEncryptionPaddings); in setPrivateKeyEntry()
503 importArgs.addEnums(KeymasterDefs.KM_TAG_PADDING, in setPrivateKeyEntry()
506 importArgs.addDateIfNotNull(KeymasterDefs.KM_TAG_ACTIVE_DATETIME, in setPrivateKeyEntry()
508 importArgs.addDateIfNotNull(KeymasterDefs.KM_TAG_ORIGINATION_EXPIRE_DATETIME, in setPrivateKeyEntry()
510 importArgs.addDateIfNotNull(KeymasterDefs.KM_TAG_USAGE_EXPIRE_DATETIME, in setPrivateKeyEntry()
[all …]
DAndroidKeyStoreECDSASignatureSpi.java25 import android.security.keymaster.KeymasterDefs;
42 super(KeymasterDefs.KM_DIGEST_NONE); in NONE()
113 super(KeymasterDefs.KM_DIGEST_SHA1); in SHA1()
119 super(KeymasterDefs.KM_DIGEST_SHA_2_224); in SHA224()
125 super(KeymasterDefs.KM_DIGEST_SHA_2_256); in SHA256()
131 super(KeymasterDefs.KM_DIGEST_SHA_2_384); in SHA384()
137 super(KeymasterDefs.KM_DIGEST_SHA_2_512); in SHA512()
162 long keySizeBits = keyCharacteristics.getUnsignedInt(KeymasterDefs.KM_TAG_KEY_SIZE, -1); in initKey()
187 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_ALGORITHM, KeymasterDefs.KM_ALGORITHM_EC); in addAlgorithmSpecificParametersToBegin()
188 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_DIGEST, mKeymasterDigest); in addAlgorithmSpecificParametersToBegin()
DAndroidKeyStore3DESCipherSpi.java20 import android.security.keymaster.KeymasterDefs;
65 super(KeymasterDefs.KM_MODE_ECB, keymasterPadding, false); in ECB()
70 super(KeymasterDefs.KM_PAD_NONE); in NoPadding()
76 super(KeymasterDefs.KM_PAD_PKCS7); in PKCS7Padding()
83 super(KeymasterDefs.KM_MODE_CBC, keymasterPadding, true); in CBC()
88 super(KeymasterDefs.KM_PAD_NONE); in NoPadding()
94 super(KeymasterDefs.KM_PAD_PKCS7); in PKCS7Padding()
259 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_ALGORITHM, KeymasterDefs.KM_ALGORITHM_3DES); in addAlgorithmSpecificParametersToBegin()
260 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_BLOCK_MODE, mKeymasterBlockMode); in addAlgorithmSpecificParametersToBegin()
261 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_PADDING, mKeymasterPadding); in addAlgorithmSpecificParametersToBegin()
[all …]
DAndroidKeyStoreHmacSpi.java23 import android.security.keymaster.KeymasterDefs;
43 super(KeymasterDefs.KM_DIGEST_SHA1); in HmacSHA1()
49 super(KeymasterDefs.KM_DIGEST_SHA_2_224); in HmacSHA224()
55 super(KeymasterDefs.KM_DIGEST_SHA_2_256); in HmacSHA256()
61 super(KeymasterDefs.KM_DIGEST_SHA_2_384); in HmacSHA384()
67 super(KeymasterDefs.KM_DIGEST_SHA_2_512); in HmacSHA512()
162 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_ALGORITHM, KeymasterDefs.KM_ALGORITHM_HMAC); in ensureKeystoreOperationInitialized()
163 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_DIGEST, mKeymasterDigest); in ensureKeystoreOperationInitialized()
164 keymasterArgs.addUnsignedInt(KeymasterDefs.KM_TAG_MAC_LENGTH, mMacSizeBits); in ensureKeystoreOperationInitialized()
168 KeymasterDefs.KM_PURPOSE_SIGN, in ensureKeystoreOperationInitialized()
DAttestationUtils.java30 import android.security.keymaster.KeymasterDefs;
125 attestArgs.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_CHALLENGE, attestationChallenge); in prepareAttestationArguments()
146 attestArgs.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_ID_SERIAL, in prepareAttestationArguments()
154 attestArgs.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_ID_IMEI, in prepareAttestationArguments()
163 attestArgs.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_ID_MEID, in prepareAttestationArguments()
171 attestArgs.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_ID_BRAND, in prepareAttestationArguments()
173 attestArgs.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_ID_DEVICE, in prepareAttestationArguments()
175 attestArgs.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_ID_PRODUCT, in prepareAttestationArguments()
177 attestArgs.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_ID_MANUFACTURER, in prepareAttestationArguments()
179 attestArgs.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_ID_MODEL, in prepareAttestationArguments()
DAndroidKeyStoreKeyPairGeneratorSpi.java28 import android.security.keymaster.KeymasterDefs;
98 super(KeymasterDefs.KM_ALGORITHM_RSA); in RSA()
104 super(KeymasterDefs.KM_ALGORITHM_EC); in EC()
222 case KeymasterDefs.KM_ALGORITHM_EC: in initialize()
237 case KeymasterDefs.KM_ALGORITHM_RSA: in initialize()
384 case KeymasterDefs.KM_ALGORITHM_RSA: in initAlgorithmSpecificParameters()
416 case KeymasterDefs.KM_ALGORITHM_EC: in initAlgorithmSpecificParameters()
496 args.addBytes(KeymasterDefs.KM_TAG_ATTESTATION_CHALLENGE, challenge); in createCertificateChain()
536 args.addUnsignedInt(KeymasterDefs.KM_TAG_KEY_SIZE, mKeySizeBits); in constructKeyGenerationArguments()
537 args.addEnum(KeymasterDefs.KM_TAG_ALGORITHM, mKeymasterAlgorithm); in constructKeyGenerationArguments()
[all …]
DAndroidKeyStoreAuthenticatedAESCipherSpi.java25 import android.security.keymaster.KeymasterDefs;
62 super(KeymasterDefs.KM_MODE_GCM, keymasterPadding); in GCM()
216 keymasterArgs.addUnsignedInt(KeymasterDefs.KM_TAG_MAC_LENGTH, mTagLengthBits); in addAlgorithmSpecificParametersToBegin()
225 super(KeymasterDefs.KM_PAD_NONE); in NoPadding()
297 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_ALGORITHM, KeymasterDefs.KM_ALGORITHM_AES); in addAlgorithmSpecificParametersToBegin()
298 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_BLOCK_MODE, mKeymasterBlockMode); in addAlgorithmSpecificParametersToBegin()
299 keymasterArgs.addEnum(KeymasterDefs.KM_TAG_PADDING, mKeymasterPadding); in addAlgorithmSpecificParametersToBegin()
301 keymasterArgs.addBytes(KeymasterDefs.KM_TAG_NONCE, mIv); in addAlgorithmSpecificParametersToBegin()
311 byte[] returnedIv = keymasterArgs.getBytes(KeymasterDefs.KM_TAG_NONCE, null); in loadAlgorithmSpecificParametersFromBeginResult()
416 keymasterArgs.addBytes(KeymasterDefs.KM_TAG_ASSOCIATED_DATA, input); in update()
DAndroidKeyStoreProvider.java23 import android.security.keymaster.KeymasterDefs;
247 privateKeyAlias, KeymasterDefs.KM_KEY_FORMAT_X509, null, null, uid); in loadAndroidKeyStorePublicKeyFromKeystore()
255 Integer keymasterAlgorithm = keyCharacteristics.getEnum(KeymasterDefs.KM_TAG_ALGORITHM); in loadAndroidKeyStorePublicKeyFromKeystore()
325 Integer keymasterAlgorithm = keyCharacteristics.getEnum(KeymasterDefs.KM_TAG_ALGORITHM); in loadAndroidKeyStoreSecretKeyFromKeystore()
330 List<Integer> keymasterDigests = keyCharacteristics.getEnums(KeymasterDefs.KM_TAG_DIGEST); in loadAndroidKeyStoreSecretKeyFromKeystore()
358 Integer keymasterAlgorithm = keyCharacteristics.getEnum(KeymasterDefs.KM_TAG_ALGORITHM); in loadAndroidKeyStoreKeyFromKeystore()
363 if (keymasterAlgorithm == KeymasterDefs.KM_ALGORITHM_HMAC || in loadAndroidKeyStoreKeyFromKeystore()
364 keymasterAlgorithm == KeymasterDefs.KM_ALGORITHM_AES || in loadAndroidKeyStoreKeyFromKeystore()
365 keymasterAlgorithm == KeymasterDefs.KM_ALGORITHM_3DES) { in loadAndroidKeyStoreKeyFromKeystore()
368 } else if (keymasterAlgorithm == KeymasterDefs.KM_ALGORITHM_RSA || in loadAndroidKeyStoreKeyFromKeystore()
[all …]
DKeyStoreCryptoOperationUtils.java20 import android.security.keymaster.KeymasterDefs;
82 case KeymasterDefs.KM_ERROR_INVALID_NONCE: in getExceptionForCipherInit()
84 case KeymasterDefs.KM_ERROR_CALLER_NONCE_PROHIBITED: in getExceptionForCipherInit()
DKeyStoreCryptoOperationChunkedStreamer.java22 import android.security.keymaster.KeymasterDefs;
146 throw new KeyStoreException(KeymasterDefs.KM_ERROR_UNKNOWN_ERROR, in update()
159 throw new KeyStoreException(KeymasterDefs.KM_ERROR_UNKNOWN_ERROR, in update()
266 throw new KeyStoreException(KeymasterDefs.KM_ERROR_UNKNOWN_ERROR, in flush()
294 throw new KeyStoreException(KeymasterDefs.KM_ERROR_INVALID_INPUT_LENGTH, in flush()
DAndroidKeyStoreSignatureSpiBase.java25 import android.security.keymaster.KeymasterDefs;
204 mSigning ? KeymasterDefs.KM_PURPOSE_SIGN : KeymasterDefs.KM_PURPOSE_VERIFY, in ensureKeystoreOperationInitialized()
367 case KeymasterDefs.KM_ERROR_VERIFICATION_FAILED: in engineVerify()
/frameworks/base/core/java/android/security/keymaster/
DKeymasterArguments.java70 int tagType = KeymasterDefs.getTagType(tag); in addEnum()
71 if ((tagType != KeymasterDefs.KM_ENUM) && (tagType != KeymasterDefs.KM_ENUM_REP)) { in addEnum()
83 if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_ENUM_REP) { in addEnums()
98 if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_ENUM) { in getEnum()
114 if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_ENUM_REP) { in getEnums()
141 int tagType = KeymasterDefs.getTagType(tag); in addUnsignedInt()
142 if ((tagType != KeymasterDefs.KM_UINT) && (tagType != KeymasterDefs.KM_UINT_REP)) { in addUnsignedInt()
159 if (KeymasterDefs.getTagType(tag) != KeymasterDefs.KM_UINT) { in getUnsignedInt()
177 int tagType = KeymasterDefs.getTagType(tag); in addUnsignedLong()
178 if ((tagType != KeymasterDefs.KM_ULONG) && (tagType != KeymasterDefs.KM_ULONG_REP)) { in addUnsignedLong()
[all …]
DKeymasterArgument.java39 switch (KeymasterDefs.getTagType(tag)) {
40 case KeymasterDefs.KM_ENUM:
41 case KeymasterDefs.KM_ENUM_REP:
42 case KeymasterDefs.KM_UINT:
43 case KeymasterDefs.KM_UINT_REP:
45 case KeymasterDefs.KM_ULONG:
46 case KeymasterDefs.KM_ULONG_REP:
48 case KeymasterDefs.KM_DATE:
50 case KeymasterDefs.KM_BYTES:
51 case KeymasterDefs.KM_BIGNUM:
[all …]
DKeymasterIntArgument.java29 switch (KeymasterDefs.getTagType(tag)) { in KeymasterIntArgument()
30 case KeymasterDefs.KM_UINT: in KeymasterIntArgument()
31 case KeymasterDefs.KM_UINT_REP: in KeymasterIntArgument()
32 case KeymasterDefs.KM_ENUM: in KeymasterIntArgument()
33 case KeymasterDefs.KM_ENUM_REP: in KeymasterIntArgument()
DKeymasterBlobArgument.java29 switch (KeymasterDefs.getTagType(tag)) { in KeymasterBlobArgument()
30 case KeymasterDefs.KM_BIGNUM: in KeymasterBlobArgument()
31 case KeymasterDefs.KM_BYTES: in KeymasterBlobArgument()
DKeymasterLongArgument.java29 switch (KeymasterDefs.getTagType(tag)) { in KeymasterLongArgument()
30 case KeymasterDefs.KM_ULONG: in KeymasterLongArgument()
31 case KeymasterDefs.KM_ULONG_REP: in KeymasterLongArgument()
DKeymasterBooleanArgument.java31 switch (KeymasterDefs.getTagType(tag)) { in KeymasterBooleanArgument()
32 case KeymasterDefs.KM_BOOL: in KeymasterBooleanArgument()
DKeymasterDateArgument.java30 switch (KeymasterDefs.getTagType(tag)) { in KeymasterDateArgument()
31 case KeymasterDefs.KM_DATE: in KeymasterDateArgument()

12