/aosp12/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/keys/ |
H A D | KeyWrapUtils.java | 26 import javax.crypto.Cipher; 72 Cipher cipher = getCipher(); in unwrap() 75 Cipher.UNWRAP_MODE, in unwrap() 79 return (SecretKey) cipher.unwrap(wrappedKey.key, KEY_ALGORITHM, Cipher.SECRET_KEY); in unwrap() 94 Cipher cipher = getCipher(); in wrap() 95 cipher.init(Cipher.WRAP_MODE, secondaryKey); in wrap() 126 private static Cipher getCipher() throws NoSuchPaddingException, NoSuchAlgorithmException { in getCipher() 127 return Cipher.getInstance(AES_GCM_MODE); in getCipher()
|
/aosp12/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/ |
H A D | WrappedKey.java | 32 import javax.crypto.Cipher; 72 Cipher cipher; in fromSecretKey() 74 cipher = Cipher.getInstance(KEY_WRAP_CIPHER_ALGORITHM); in fromSecretKey() 80 cipher.init(Cipher.WRAP_MODE, wrappingKey.getKey()); in fromSecretKey() 206 Cipher cipher = Cipher.getInstance(KEY_WRAP_CIPHER_ALGORITHM); in unwrapKeys() 222 Cipher.UNWRAP_MODE, in unwrapKeys() 228 wrappedKey.getKeyMaterial(), APPLICATION_KEY_ALGORITHM, Cipher.SECRET_KEY); in unwrapKeys()
|
/aosp12/frameworks/base/services/core/java/com/android/server/locksettings/ |
H A D | AesEncryptionUtil.java | 30 import javax.crypto.Cipher; 63 Cipher c = Cipher.getInstance(CIPHER_ALGO); in decrypt() 64 c.init(Cipher.DECRYPT_MODE, key, new GCMParameterSpec(128, iv)); in decrypt() 93 Cipher cipher = Cipher.getInstance(CIPHER_ALGO); in encrypt() 94 cipher.init(Cipher.ENCRYPT_MODE, key); in encrypt()
|
H A D | ManagedProfilePasswordCache.java | 40 import javax.crypto.Cipher; 114 Cipher cipher; in storePassword() 116 cipher = Cipher.getInstance("AES/GCM/NoPadding"); in storePassword() 117 cipher.init(Cipher.ENCRYPT_MODE, key); in storePassword() 152 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in retrievePassword() 153 cipher.init(Cipher.DECRYPT_MODE, key, new GCMParameterSpec(128, iv)); in retrievePassword()
|
H A D | SyntheticPasswordCrypto.java | 42 import javax.crypto.Cipher; 69 Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" in decrypt() 71 cipher.init(Cipher.DECRYPT_MODE, key, new GCMParameterSpec(DEFAULT_TAG_LENGTH_BITS, iv)); in decrypt() 82 Cipher cipher = Cipher.getInstance( in encrypt() 85 cipher.init(Cipher.ENCRYPT_MODE, key); in encrypt()
|
/aosp12/frameworks/base/core/java/android/hardware/biometrics/ |
H A D | CryptoObject.java | 25 import javax.crypto.Cipher; 41 public CryptoObject(@NonNull Cipher cipher) { in CryptoObject() 65 public Cipher getCipher() { in getCipher() 66 return mCrypto instanceof Cipher ? (Cipher) mCrypto : null; in getCipher()
|
/aosp12/frameworks/base/packages/BackupEncryption/proto/ |
H A D | wrapped_key.proto | 10 // Type of Cipher algorithm the key is used for. 17 // What kind of Cipher algorithm the key is used for. We assume at the moment 20 // change Cipher algorithm. 26 // The Cipher with which the key was encrypted. 36 // Cipher algorithm used to wrap the key. We assume at the moment that this 38 // forwards compatibility if at some point we need to change Cipher algorithm. 41 // The nonce used to initialize the Cipher in AES/256/GCM mode.
|
/aosp12/frameworks/base/services/core/java/com/android/server/accounts/ |
H A D | CryptoHelper.java | 15 import javax.crypto.Cipher; 64 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in encryptBundle() 65 cipher.init(Cipher.ENCRYPT_MODE, mEncryptionKey); in encryptBundle() 90 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in decryptBundle() 91 cipher.init(Cipher.DECRYPT_MODE, mEncryptionKey, ivSpec); in decryptBundle()
|
/aosp12/packages/apps/Car/Dialer/src/com/android/car/dialer/storage/ |
H A D | CipherConverter.java | 41 import javax.crypto.Cipher; 78 Cipher cipher = getCipherInstance(); in decrypt() 89 cipher.init(Cipher.DECRYPT_MODE, decryptionKey, new GCMParameterSpec(128, iv)); in decrypt() 130 Cipher cipher = getCipherInstance(); in encrypt() 131 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in encrypt() 156 private Cipher getCipherInstance() in getCipherInstance() 158 return Cipher.getInstance( in getCipherInstance()
|
/aosp12/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/ |
H A D | WrappedKeyTest.java | 40 import javax.crypto.Cipher; 76 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nullMetadata() 78 Cipher.UNWRAP_MODE, in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nullMetadata() 82 wrappedKey.getKeyMaterial(), KEY_ALGORITHM, Cipher.SECRET_KEY); in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nullMetadata() 95 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nonNullMetadata() 97 Cipher.UNWRAP_MODE, in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nonNullMetadata() 101 wrappedKey.getKeyMaterial(), KEY_ALGORITHM, Cipher.SECRET_KEY); in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nonNullMetadata()
|
H A D | RecoverableKeyGeneratorTest.java | 45 import javax.crypto.Cipher; 130 Cipher cipher = Cipher.getInstance(KEY_WRAP_ALGORITHM); in generateAndStoreKey_storesTheWrappedVersionOfTheRawMaterial() 131 cipher.init(Cipher.DECRYPT_MODE, mDecryptKey.getKey(), in generateAndStoreKey_storesTheWrappedVersionOfTheRawMaterial() 164 Cipher cipher = Cipher.getInstance(KEY_WRAP_ALGORITHM); in importKey_storesTheWrappedVersionOfTheRawMaterial() 165 cipher.init(Cipher.DECRYPT_MODE, mDecryptKey.getKey(), in importKey_storesTheWrappedVersionOfTheRawMaterial()
|
/aosp12/packages/modules/Wifi/service/java/com/android/server/wifi/util/ |
H A D | WifiConfigStoreEncryptionUtil.java | 38 import javax.crypto.Cipher; 87 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in encrypt() 90 cipher.init(Cipher.ENCRYPT_MODE, secretKeyReference); in encrypt() 121 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in decrypt() 125 cipher.init(Cipher.DECRYPT_MODE, secretKeyReference, spec); in decrypt()
|
/aosp12/frameworks/base/keystore/java/android/security/keystore2/ |
H A D | AndroidKeyStoreCipherSpiBase.java | 54 import javax.crypto.Cipher; 105 private Cipher mCipher; 245 case Cipher.ENCRYPT_MODE: in init() 246 case Cipher.WRAP_MODE: in init() 249 case Cipher.DECRYPT_MODE: in init() 250 case Cipher.UNWRAP_MODE: in init() 796 case Cipher.SECRET_KEY: in engineUnwrap() 801 case Cipher.PRIVATE_KEY: in engineUnwrap() 812 case Cipher.PUBLIC_KEY: in engineUnwrap() 906 case Cipher.WRAP_MODE: in opmodeToString() [all …]
|
H A D | AndroidKeyStoreRSACipherSpi.java | 38 import javax.crypto.Cipher; 404 case Cipher.DECRYPT_MODE: in initKey() 405 case Cipher.UNWRAP_MODE: in initKey() 408 case Cipher.ENCRYPT_MODE: in initKey() 409 case Cipher.WRAP_MODE: in initKey() 425 case Cipher.ENCRYPT_MODE: in initKey() 426 case Cipher.WRAP_MODE: in initKey() 429 case Cipher.DECRYPT_MODE: in initKey() 430 case Cipher.UNWRAP_MODE: in initKey()
|
/aosp12/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/chunking/ |
H A D | ChunkEncryptor.java | 27 import javax.crypto.Cipher; 63 Cipher cipher; in encrypt() 65 cipher = Cipher.getInstance(CIPHER_ALGORITHM); in encrypt() 67 Cipher.ENCRYPT_MODE, in encrypt()
|
/aosp12/packages/modules/IPsec/src/java/com/android/internal/net/ipsec/ike/crypto/ |
H A D | IkeCombinedModeCipher.java | 30 import javax.crypto.Cipher; 110 if (opmode == Cipher.ENCRYPT_MODE) outputLen += mChecksumLen; in doCipherAction() 124 Cipher.ENCRYPT_MODE == opmode in doCipherAction() 160 paddedData, additionalAuthData, keyBytes, ivBytes, Cipher.ENCRYPT_MODE); in encrypt() 189 Cipher.DECRYPT_MODE); in decrypt()
|
H A D | IkeNormalModeCipher.java | 28 import javax.crypto.Cipher; 94 Cipher.ENCRYPT_MODE == opmode in doCipherAction() 111 return doCipherAction(paddedData, keyBytes, ivBytes, Cipher.ENCRYPT_MODE); in encrypt() 129 return doCipherAction(encryptedData, keyBytes, ivBytes, Cipher.DECRYPT_MODE); in decrypt()
|
H A D | AesXCbcImpl.java | 28 import javax.crypto.Cipher; 44 private final Cipher mCipher; 53 mCipher = Cipher.getInstance(AES_CBC); in AesXCbcImpl() 147 Cipher.ENCRYPT_MODE, new SecretKeySpec(keyBytes, mCipher.getAlgorithm()), iv); in encryptAesBlock()
|
H A D | IkeCipher.java | 29 import javax.crypto.Cipher; 82 protected final Cipher mCipher; 98 mCipher = Cipher.getInstance(getAlgorithmName()); in IkeCipher()
|
/aosp12/frameworks/base/packages/BackupEncryption/test/robolectric/src/com/android/server/backup/encryption/chunking/ |
H A D | ChunkEncryptorTest.java | 43 import javax.crypto.Cipher; 149 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in encrypt_decryptedResultCorrespondsToPlaintext() 151 Cipher.DECRYPT_MODE, in encrypt_decryptedResultCorrespondsToPlaintext()
|
/aosp12/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/tasks/ |
H A D | BackupFileDecryptorTask.java | 38 import javax.crypto.Cipher; 79 private final Cipher mCipher; 89 this.mCipher = Cipher.getInstance(CIPHER_ALGORITHM); in BackupFileDecryptorTask() 229 Cipher.DECRYPT_MODE, in decryptChunk() 288 Cipher.DECRYPT_MODE, in decryptChunkOrdering()
|
H A D | EncryptedBackupTask.java | 48 import javax.crypto.Cipher; 212 Cipher cipher = Cipher.getInstance(CIPHER_ALGORITHM); in encryptChunkOrdering() 217 Cipher.ENCRYPT_MODE, in encryptChunkOrdering()
|
/aosp12/packages/modules/Connectivity/tests/cts/net/src/android/net/cts/ |
H A D | PacketUtils.java | 36 import javax.crypto.Cipher; 607 final Cipher cipher = Cipher.getInstance(algoName); in getCipherText() 608 cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec); in getCipherText() 650 final Cipher cipher = Cipher.getInstance(algoName); in getCipherText() 651 cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, ivParameterSpec); in getCipherText() 690 final Cipher aesCipher = Cipher.getInstance(AES_CBC); in getIcv()
|
/aosp12/frameworks/base/services/backup/java/com/android/server/backup/fullbackup/ |
H A D | PerformAdbBackupTask.java | 59 import javax.crypto.Cipher; 159 Cipher c = Cipher.getInstance("AES/CBC/PKCS5Padding"); in emitAesBackupHeader() 161 c.init(Cipher.ENCRYPT_MODE, encryptionKeySpec); in emitAesBackupHeader() 178 Cipher mkC = Cipher.getInstance("AES/CBC/PKCS5Padding"); in emitAesBackupHeader() 179 mkC.init(Cipher.ENCRYPT_MODE, userKey); in emitAesBackupHeader()
|
/aosp12/frameworks/base/identity/java/android/security/identity/ |
H A D | CredstoreIdentityCredential.java | 46 import javax.crypto.Cipher; 172 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in encryptMessageToReader() 174 cipher.init(Cipher.ENCRYPT_MODE, mSecretKey, encryptionParameterSpec); in encryptMessageToReader() 197 final Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in decryptMessageFromReader() 198 cipher.init(Cipher.DECRYPT_MODE, mReaderSecretKey, in decryptMessageFromReader()
|