Home
last modified time | relevance | path

Searched refs:Cipher (Results 1 – 25 of 71) sorted by relevance

123

/aosp12/frameworks/base/packages/BackupEncryption/src/com/android/server/backup/encryption/keys/
H A DKeyWrapUtils.java26 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 DWrappedKey.java32 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 DAesEncryptionUtil.java30 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 DManagedProfilePasswordCache.java40 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 DSyntheticPasswordCrypto.java42 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 DCryptoObject.java25 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 Dwrapped_key.proto10 // 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 DCryptoHelper.java15 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 DCipherConverter.java41 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 DWrappedKeyTest.java40 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 DRecoverableKeyGeneratorTest.java45 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 DWifiConfigStoreEncryptionUtil.java38 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 DAndroidKeyStoreCipherSpiBase.java54 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 DAndroidKeyStoreRSACipherSpi.java38 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 DChunkEncryptor.java27 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 DIkeCombinedModeCipher.java30 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 DIkeNormalModeCipher.java28 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 DAesXCbcImpl.java28 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 DIkeCipher.java29 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 DChunkEncryptorTest.java43 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 DBackupFileDecryptorTask.java38 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 DEncryptedBackupTask.java48 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 DPacketUtils.java36 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 DPerformAdbBackupTask.java59 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 DCredstoreIdentityCredential.java46 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()

123