Home
last modified time | relevance | path

Searched refs:publicKey (Results 1 – 17 of 17) sorted by relevance

/cts/tests/tests/keystore/src/android/keystore/cts/
DRSACipherTest.java83 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() local
85 BigInteger modulus = ((RSAKey) publicKey).getModulus(); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
94 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
117 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() local
119 BigInteger modulus = ((RSAKey) publicKey).getModulus(); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
125 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
146 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus() local
147 BigInteger modulus = ((RSAKey) publicKey).getModulus(); in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus()
152 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus()
175 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionFailsWithPlaintextOneLargerThanModulus() local
[all …]
DRSASignatureTest.java76 PublicKey publicKey = keyPair.getKeystoreBackedKeyPair().getPublic(); in testMaxMessageSizeWhenNoDigestUsed() local
78 int modulusSizeBits = ((RSAKey) publicKey).getModulus().bitLength(); in testMaxMessageSizeWhenNoDigestUsed()
93 signature.initVerify(publicKey); in testMaxMessageSizeWhenNoDigestUsed()
107 signature.initVerify(publicKey); in testMaxMessageSizeWhenNoDigestUsed()
DKeyFactoryTest.java243 PublicKey publicKey = keyPair.getPublic(); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec() local
247 keyFactory.getKeySpec(publicKey, X509EncodedKeySpec.class); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec()
248 MoreAsserts.assertEquals(publicKey.getEncoded(), x509EncodedSpec.getEncoded()); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec()
264 PublicKey publicKey = keyPair.getPublic(); in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec() local
268 ECPublicKey ecPublicKey = (ECPublicKey) publicKey; in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec()
270 keyFactory.getKeySpec(publicKey, ECPublicKeySpec.class); in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec()
275 RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey; in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec()
277 keyFactory.getKeySpec(publicKey, RSAPublicKeySpec.class); in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec()
DImportWrappedKeyTest.java330 PublicKey publicKey = kp.getPublic(); in testKeyStore_ImportWrappedKey_RSA() local
365 c.init(Cipher.DECRYPT_MODE, publicKey); in testKeyStore_ImportWrappedKey_RSA()
369 c.init(Cipher.ENCRYPT_MODE, publicKey); in testKeyStore_ImportWrappedKey_RSA()
381 s.initVerify(publicKey); in testKeyStore_ImportWrappedKey_RSA()
409 PublicKey publicKey = kp.getPublic(); in testKeyStore_ImportWrappedKey_EC() local
445 s.initVerify(publicKey); in testKeyStore_ImportWrappedKey_EC()
467 public byte[] wrapKey(PublicKey publicKey, byte[] keyMaterial, byte[] mask, in wrapKey() argument
469 return wrapKey(publicKey, keyMaterial, mask, keyFormat, authorizationList, true); in wrapKey()
472 public byte[] wrapKey(PublicKey publicKey, byte[] keyMaterial, byte[] mask, in wrapKey() argument
493 pkCipher.init(Cipher.ENCRYPT_MODE, publicKey, spec); in wrapKey()
[all …]
DSignatureTest.java591 PublicKey publicKey = key.getOriginalKeyPair().getPublic(); in testSignatureGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider() local
594 signature.initVerify(publicKey); in testSignatureGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider()
601 sigAlgorithm, verificationProvider, publicKey, message, sigBytes); in testSignatureGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider()
1135 PublicKey publicKey = TestUtils.importIntoAndroidKeyStore( in assertInitVerifySucceeds() local
1140 signature.initVerify(publicKey); in assertInitVerifySucceeds()
1239 PublicKey publicKey, in assertSignatureVerifiesOneShot() argument
1242 assertSignatureVerifiesOneShot(algorithm, null, publicKey, message, signature); in assertSignatureVerifiesOneShot()
1248 PublicKey publicKey, in assertSignatureVerifiesOneShot() argument
1253 sig.initVerify(publicKey); in assertSignatureVerifiesOneShot()
1266 PublicKey publicKey, in assertSignatureDoesNotVerifyOneShot() argument
[all …]
DAndroidKeyStoreTest.java2041 PublicKey publicKey = ks.getCertificate(alias).getPublicKey(); in testKeyStore_Encrypting_RSA_NONE_NOPADDING() local
2042 assertNotNull(publicKey); in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
2048 int modulusSizeBytes = (((RSAKey) publicKey).getModulus().bitLength() + 7) / 8; in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
2073 PublicKey publicKey = mKeyStore.getCertificate(getTestAlias2()).getPublicKey(); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto() local
2074 assertNotNull(publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
2076 Signature.getInstance("SHA256withRSA").initVerify(publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
2077 Signature.getInstance("NONEwithRSA").initVerify(publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
2078 Signature.getInstance("SHA256withRSA/PSS").initVerify(publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
2080 Cipher.getInstance("RSA/ECB/PKCS1Padding").init(Cipher.ENCRYPT_MODE, publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
2081 Cipher.getInstance("RSA/ECB/NoPadding").init(Cipher.ENCRYPT_MODE, publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
[all …]
DKeyPairGeneratorTest.java907 for (PublicKey publicKey : publicKeys) { in testRSA_Key_Quality_Not_Perfect_SquareHelper()
908 RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey; in testRSA_Key_Quality_Not_Perfect_SquareHelper()
916 + HexDump.dumpHexString(publicKey.getEncoded())); in testRSA_Key_Quality_Not_Perfect_SquareHelper()
927 for (PublicKey publicKey : publicKeys) { in testRSA_Key_Quality_Public_Modulus_GCD_Is_One_Helper()
928 RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey; in testRSA_Key_Quality_Public_Modulus_GCD_Is_One_Helper()
935 for (PublicKey publicKey : publicKeys) { in testRSA_Key_Quality_Public_Modulus_GCD_Is_One_Helper()
936 RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey; in testRSA_Key_Quality_Public_Modulus_GCD_Is_One_Helper()
942 Log.i(TAG, "Key: " + HexDump.dumpHexString(publicKey.getEncoded())); in testRSA_Key_Quality_Public_Modulus_GCD_Is_One_Helper()
946 + HexDump.dumpHexString(publicKey.getEncoded()) in testRSA_Key_Quality_Public_Modulus_GCD_Is_One_Helper()
DCurve25519Test.java177 EdECPublicKey publicKey = (EdECPublicKey) kp.getPublic(); in ed25519KeyGenerationAndSigningTest() local
DDeviceOwnerKeyManagementTest.java132 void verifySignature(String algoIdentifier, PublicKey publicKey, byte[] signature) in verifySignature() argument
136 verify.initVerify(publicKey); in verifySignature()
/cts/tests/tests/telephony/current/src/android/telephony/cts/
DImsiEncryptionInfoTest.java57 PublicKey publicKey = createPublicKey(TEST_CERT); in testParcel() local
61 byte[] b = publicKey.getEncoded(); in testParcel()
72 assertEquals(publicKey, info.getPublicKey()); in testParcel()
/cts/hostsidetests/devicepolicy/app/CertInstaller/src/com/android/cts/certinstaller/
DPreSelectedKeyAccessTest.java57 PublicKey publicKey = certs[0].getPublicKey(); in testAccessingPreSelectedAliasExpectingSuccess() local
59 verify.initVerify(publicKey); in testAccessingPreSelectedAliasExpectingSuccess()
/cts/tests/tests/keystore/src/android/keystore/cts/util/
DTestUtils.java286 public static void assertKeyPairSelfConsistent(PublicKey publicKey, PrivateKey privateKey) { in assertKeyPairSelfConsistent() argument
287 assertNotNull(publicKey); in assertKeyPairSelfConsistent()
289 assertEquals(publicKey.getAlgorithm(), privateKey.getAlgorithm()); in assertKeyPairSelfConsistent()
290 String keyAlgorithm = publicKey.getAlgorithm(); in assertKeyPairSelfConsistent()
293 + publicKey.getClass().getName(), in assertKeyPairSelfConsistent()
294 publicKey instanceof ECKey); in assertKeyPairSelfConsistent()
300 ((ECKey) publicKey).getParams(), ((ECKey) privateKey).getParams()); in assertKeyPairSelfConsistent()
303 + publicKey.getClass().getName(), in assertKeyPairSelfConsistent()
304 publicKey instanceof RSAKey); in assertKeyPairSelfConsistent()
309 ((RSAKey) publicKey).getModulus(), ((RSAKey) privateKey).getModulus()); in assertKeyPairSelfConsistent()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/security/
DCredentialManagementAppActivity.java304 PublicKey publicKey = certChain[0].getPublicKey(); in getPublicKeyAndVerifySignature() local
308 verify.initVerify(publicKey); in getPublicKeyAndVerifySignature()
/cts/tests/devicepolicy/src/android/devicepolicy/cts/
DCredentialManagementAppTest.java379 void verifySignature(String algoIdentifier, PublicKey publicKey, byte[] signature) in verifySignature() argument
383 verify.initVerify(publicKey); in verifySignature()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DKeyManagementTest.java181 void verifySignature(String algoIdentifier, PublicKey publicKey, byte[] signature) in verifySignature() argument
185 verify.initVerify(publicKey); in verifySignature()
/cts/tests/tests/content/src/android/content/pm/cts/
DPackageManagerTest.java3335 PublicKey publicKey = certificate.getPublicKey(); in testInstallArchivedApi() local
3338 List.of(publicKey), null); in testInstallArchivedApi()
3379 List.of(publicKey)); in testInstallArchivedApi()
/cts/common/device-side/bedstead/remoteframeworkclasses/java/apis/
Dcurrent.txt1347 field public static final int publicKey = 16843686; // 0x10103a6