Home
last modified time | relevance | path

Searched refs:privateKey (Results 1 – 21 of 21) sorted by relevance

/cts/common/device-side/util-axt/src/com/android/compatibility/common/util/
DFakeKeys.java37 public static final byte[] privateKey = { field in FakeKeys.FAKE_RSA_1
292 public static final byte[] privateKey = { field in FakeKeys.FAKE_DSA_1
/cts/hostsidetests/devicepolicy/app/CertInstaller/src/com/android/cts/certinstaller/
DPreSelectedKeyAccessTest.java44 PrivateKey privateKey = KeyChain.getPrivateKey(getContext(), PRE_SELECTED_ALIAS); in testAccessingPreSelectedAliasExpectingSuccess() local
45 assertThat(privateKey).isNotNull(); in testAccessingPreSelectedAliasExpectingSuccess()
50 sign.initSign(privateKey); in testAccessingPreSelectedAliasExpectingSuccess()
DCertSelectionDelegateTest.java105 final PrivateKey privKey = getPrivateKey(FAKE_RSA_1.privateKey, "RSA"); in testCanSelectKeychainKeypairs()
/cts/tests/tests/keystore/src/android/keystore/cts/
DRSACipherTest.java84 PrivateKey privateKey = key.getKeystoreBackedKeyPair().getPrivate(); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() local
97 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
118 PrivateKey privateKey = key.getKeystoreBackedKeyPair().getPrivate(); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() local
127 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
239 PrivateKey privateKey = key.getKeystoreBackedKeyPair().getPrivate(); in testNoPaddingDecryptionFailsWithCiphertextOneByteLongerThanModulus() local
240 BigInteger modulus = ((RSAKey) privateKey).getModulus(); in testNoPaddingDecryptionFailsWithCiphertextOneByteLongerThanModulus()
248 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingDecryptionFailsWithCiphertextOneByteLongerThanModulus()
272 PrivateKey privateKey = key.getKeystoreBackedKeyPair().getPrivate(); in testNoPaddingWithZeroMessage() local
282 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingWithZeroMessage()
DRSASignatureTest.java77 PrivateKey privateKey = keyPair.getKeystoreBackedKeyPair().getPrivate(); in testMaxMessageSizeWhenNoDigestUsed() local
89 signature.initSign(privateKey); in testMaxMessageSizeWhenNoDigestUsed()
99 signature.initSign(privateKey); in testMaxMessageSizeWhenNoDigestUsed()
DImportWrappedKeyTest.java331 PrivateKey privateKey = kp.getPrivate(); in testKeyStore_ImportWrappedKey_RSA() local
333 assertEquals(privateKey.getFormat(), "PKCS#8"); in testKeyStore_ImportWrappedKey_RSA()
335 byte[] keyMaterial = privateKey.getEncoded(); in testKeyStore_ImportWrappedKey_RSA()
410 PrivateKey privateKey = kp.getPrivate(); in testKeyStore_ImportWrappedKey_EC() local
412 assertEquals(privateKey.getFormat(), "PKCS#8"); in testKeyStore_ImportWrappedKey_EC()
414 byte[] keyMaterial = privateKey.getEncoded(); in testKeyStore_ImportWrappedKey_EC()
DSignatureTest.java626 PrivateKey privateKey = key.getOriginalKeyPair().getPrivate(); in testSignatureGeneratedByHighestPriorityProviderVerifiesByAndroidKeyStore() local
632 signature.initSign(privateKey); in testSignatureGeneratedByHighestPriorityProviderVerifiesByAndroidKeyStore()
1159 PrivateKey privateKey = TestUtils.importIntoAndroidKeyStore( in assertInitSignSucceeds() local
1164 signature.initSign(privateKey); in assertInitSignSucceeds()
1192 PrivateKey privateKey = TestUtils.importIntoAndroidKeyStore( in assertInitSignThrowsInvalidKeyException() local
1198 signature.initSign(privateKey); in assertInitSignThrowsInvalidKeyException()
1304 PrivateKey privateKey, in generateSignatureFedUsingFixedSizeChunks() argument
1308 signature.initSign(privateKey); in generateSignatureFedUsingFixedSizeChunks()
DKeyStoreTest.java345 … public static void setPrivateKeyNoPassword(KeyStore ks, String alias, PrivateKeyEntry privateKey) in setPrivateKeyNoPassword() argument
347 ks.setKeyEntry(alias, privateKey.getPrivateKey(), null, privateKey.getCertificateChain()); in setPrivateKeyNoPassword()
357 PrivateKeyEntry privateKey) in setPrivateKey() argument
360 privateKey.getPrivateKey(), in setPrivateKey()
362 privateKey.getCertificateChain()); in setPrivateKey()
373 PrivateKeyEntry privateKey) in setPrivateKeyBytes() argument
376 privateKey.getPrivateKey().getEncoded(), in setPrivateKeyBytes()
377 privateKey.getCertificateChain()); in setPrivateKeyBytes()
434 PrivateKeyEntry privateKey = (PrivateKeyEntry) actual; in assertPrivateKey() local
435 assertEquals(getPrivateKey().getPrivateKey(), privateKey.getPrivateKey()); in assertPrivateKey()
[all …]
DAndroidKeyStoreTest.java2039 PrivateKey privateKey = (PrivateKey) ks.getKey(alias, null); in testKeyStore_Encrypting_RSA_NONE_NOPADDING() local
2040 assertNotNull(privateKey); in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
2043 String cipher = privateKey.getAlgorithm() + "/NONE/NOPADDING"; in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
2046 encrypt.init(Cipher.ENCRYPT_MODE, privateKey); in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
2735 PrivateKey privateKey = generatePrivateKey("RSA", FAKE_RSA_KEY_1); in createLargeNumberOfKeyStoreEntryAliases() local
2745 new PrivateKeyEntry(privateKey, new Certificate[]{cert}), protectionParams); in createLargeNumberOfKeyStoreEntryAliases()
DDeviceOwnerKeyManagementTest.java124 byte[] signDataWithKey(String algoIdentifier, PrivateKey privateKey) throws Exception { in signDataWithKey() argument
127 sign.initSign(privateKey); in signDataWithKey()
DKeyPairGeneratorTest.java1955 PrivateKey privateKey, in assertUsableForTLSPeerAuthentication() argument
1971 TestKeyManager.wrap(new MyKeyManager(privateKey, x509CertificateChain)) in assertUsableForTLSPeerAuthentication()
1976 if ("EC".equalsIgnoreCase(privateKey.getAlgorithm())) { in assertUsableForTLSPeerAuthentication()
1981 } else if ("RSA".equalsIgnoreCase(privateKey.getAlgorithm())) { in assertUsableForTLSPeerAuthentication()
2008 fail("Unsupported key algorithm: " + privateKey.getAlgorithm()); in assertUsableForTLSPeerAuthentication()
/cts/tests/devicepolicy/src/android/devicepolicy/cts/
DCaCertManagementTest.java281 PrivateKey privateKey = KeyFactory.getInstance("RSA").generatePrivate( in installKeyPair_installsKeyPair() local
291 sDeviceState.dpc().componentName(), privateKey, certificate, ALIAS); in installKeyPair_installsKeyPair()
301 PrivateKey privateKey = KeyFactory.getInstance("RSA").generatePrivate( in installKeyPair_invalidAdmin_throwsException() local
310 sDeviceState.dpc().componentName(), privateKey, certificate, ALIAS)); in installKeyPair_invalidAdmin_throwsException()
315 PrivateKey privateKey = KeyFactory.getInstance("RSA").generatePrivate( in removeKeyPair_removedKeyPair() local
324 sDeviceState.dpc().componentName(), privateKey, certificate, ALIAS); in removeKeyPair_removedKeyPair() local
DKeyManagementTest.java82 TestApis.certificates().generateRSAPrivateKey(FakeKeys.FAKE_RSA_1.privateKey);
373 final PrivateKey privateKey = in getPrivateKey_aliasIsGranted_returnPrivateKey() local
376 assertThat(privateKey).isNotNull(); in getPrivateKey_aliasIsGranted_returnPrivateKey()
377 assertThat(privateKey.getAlgorithm()).isEqualTo( in getPrivateKey_aliasIsGranted_returnPrivateKey()
671 private byte[] signDataWithKey(String algoIdentifier, PrivateKey privateKey) throws Exception { in signDataWithKey() argument
674 sign.initSign(privateKey); in signDataWithKey()
DCredentialManagementAppTest.java79 getPrivateKey(FakeKeys.FAKE_RSA_1.privateKey, "RSA");
393 private byte[] signDataWithKey(String algoIdentifier, PrivateKey privateKey) throws Exception { in signDataWithKey() argument
396 sign.initSign(privateKey); in signDataWithKey()
DWifiTest.java109 TestApis.certificates().generateRSAPrivateKey(FakeKeys.FAKE_RSA_1.privateKey);
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DKeyChainTestActivity.java205 PrivateKey privateKey = KeyChain.getPrivateKey(KeyChainTestActivity.this, alias); in alias() local
206 if (privateKey == null) { in alias()
213 sign.initSign(privateKey); in alias()
/cts/tests/tests/keystore/src/android/keystore/cts/util/
DTestUtils.java286 public static void assertKeyPairSelfConsistent(PublicKey publicKey, PrivateKey privateKey) { in assertKeyPairSelfConsistent() argument
288 assertNotNull(privateKey); in assertKeyPairSelfConsistent()
289 assertEquals(publicKey.getAlgorithm(), privateKey.getAlgorithm()); in assertKeyPairSelfConsistent()
296 + privateKey.getClass().getName(), in assertKeyPairSelfConsistent()
297 privateKey instanceof ECKey); in assertKeyPairSelfConsistent()
300 ((ECKey) publicKey).getParams(), ((ECKey) privateKey).getParams()); in assertKeyPairSelfConsistent()
306 + privateKey.getClass().getName(), in assertKeyPairSelfConsistent()
307 privateKey instanceof RSAKey); in assertKeyPairSelfConsistent()
309 ((RSAKey) publicKey).getModulus(), ((RSAKey) privateKey).getModulus()); in assertKeyPairSelfConsistent()
324 + privateKey.getClass().getName(), in assertKeyPairSelfConsistent()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/biometrics/
DUtils.java108 PrivateKey privateKey = ((KeyStore.PrivateKeyEntry) entry).getPrivateKey(); in initSignature() local
114 signature.initSign(privateKey); in initSignature()
/cts/apps/CtsVerifier/src/com/android/cts/verifier/security/
DCredentialManagementAppActivity.java274 final PrivateKey privateKey = KeyChain.getPrivateKey( in getPrivateKeyAndSignData() local
280 sign.initSign(privateKey); in getPrivateKeyAndSignData()
DKeyChainTest.java486 PrivateKey privateKey = KeyChain.getPrivateKey(KeyChainTest.this, alias); in getPrivateKey() local
487 Log.d(TAG, "privateKey = " + privateKey); in getPrivateKey()
488 return privateKey; in getPrivateKey()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DKeyManagementTest.java123 mFakePrivKey = getPrivateKey(FAKE_RSA_1.privateKey, "RSA"); in setUp()
173 byte[] signDataWithKey(String algoIdentifier, PrivateKey privateKey) throws Exception { in signDataWithKey() argument
176 sign.initSign(privateKey); in signDataWithKey()