Home
last modified time | relevance | path

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

/cts/tests/tests/keystore/src/android/keystore/cts/
DRSACipherTest.java49 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() local
51 BigInteger modulus = ((RSAKey) publicKey).getModulus(); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
60 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus()
82 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() local
84 BigInteger modulus = ((RSAKey) publicKey).getModulus(); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
90 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus()
110 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus() local
111 BigInteger modulus = ((RSAKey) publicKey).getModulus(); in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus()
116 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionFailsWithPlaintextEqualToModulus()
138 PublicKey publicKey = key.getKeystoreBackedKeyPair().getPublic(); in testNoPaddingEncryptionFailsWithPlaintextOneLargerThanModulus() local
[all …]
DRSASignatureTest.java60 PublicKey publicKey = keyPair.getKeystoreBackedKeyPair().getPublic(); in testMaxMessageSizeWhenNoDigestUsed() local
62 int modulusSizeBits = ((RSAKey) publicKey).getModulus().bitLength(); in testMaxMessageSizeWhenNoDigestUsed()
77 signature.initVerify(publicKey); in testMaxMessageSizeWhenNoDigestUsed()
91 signature.initVerify(publicKey); in testMaxMessageSizeWhenNoDigestUsed()
DKeyFactoryTest.java215 PublicKey publicKey = keyPair.getPublic(); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec() local
219 keyFactory.getKeySpec(publicKey, X509EncodedKeySpec.class); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec()
220 MoreAsserts.assertEquals(publicKey.getEncoded(), x509EncodedSpec.getEncoded()); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec()
235 PublicKey publicKey = keyPair.getPublic(); in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec() local
239 ECPublicKey ecPublicKey = (ECPublicKey) publicKey; in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec()
241 keyFactory.getKeySpec(publicKey, ECPublicKeySpec.class); in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec()
246 RSAPublicKey rsaPublicKey = (RSAPublicKey) publicKey; in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec()
248 keyFactory.getKeySpec(publicKey, RSAPublicKeySpec.class); in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec()
DSignatureTest.java562 PublicKey publicKey = key.getOriginalKeyPair().getPublic(); in testSignatureGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider() local
565 signature.initVerify(publicKey); in testSignatureGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider()
572 sigAlgorithm, verificationProvider, publicKey, message, sigBytes); in testSignatureGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider()
1087 PublicKey publicKey = TestUtils.importIntoAndroidKeyStore( in assertInitVerifySucceeds() local
1092 signature.initVerify(publicKey); in assertInitVerifySucceeds()
1191 PublicKey publicKey, in assertSignatureVerifiesOneShot() argument
1194 assertSignatureVerifiesOneShot(algorithm, null, publicKey, message, signature); in assertSignatureVerifiesOneShot()
1200 PublicKey publicKey, in assertSignatureVerifiesOneShot() argument
1205 sig.initVerify(publicKey); in assertSignatureVerifiesOneShot()
1218 PublicKey publicKey, in assertSignatureDoesNotVerifyOneShot() argument
[all …]
DAndroidKeyStoreTest.java1916 PublicKey publicKey = ks.getCertificate(alias).getPublicKey(); in testKeyStore_Encrypting_RSA_NONE_NOPADDING() local
1917 assertNotNull(publicKey); in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
1923 int modulusSizeBytes = (((RSAKey) publicKey).getModulus().bitLength() + 7) / 8; in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
1947 PublicKey publicKey = mKeyStore.getCertificate(TEST_ALIAS_2).getPublicKey(); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto() local
1948 assertNotNull(publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
1950 Signature.getInstance("SHA256withRSA").initVerify(publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
1951 Signature.getInstance("NONEwithRSA").initVerify(publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
1952 Signature.getInstance("SHA256withRSA/PSS").initVerify(publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
1954 Cipher.getInstance("RSA/ECB/PKCS1Padding").init(Cipher.ENCRYPT_MODE, publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
1955 Cipher.getInstance("RSA/ECB/NoPadding").init(Cipher.ENCRYPT_MODE, publicKey); in testKeyStore_PrivateKeyEntry_RSA_PublicKeyWorksWithCrypto()
[all …]
DTestUtils.java162 static void assertKeyPairSelfConsistent(PublicKey publicKey, PrivateKey privateKey) { in assertKeyPairSelfConsistent() argument
163 assertNotNull(publicKey); in assertKeyPairSelfConsistent()
165 assertEquals(publicKey.getAlgorithm(), privateKey.getAlgorithm()); in assertKeyPairSelfConsistent()
166 String keyAlgorithm = publicKey.getAlgorithm(); in assertKeyPairSelfConsistent()
169 + publicKey.getClass().getName(), in assertKeyPairSelfConsistent()
170 publicKey instanceof ECKey); in assertKeyPairSelfConsistent()
176 ((ECKey) publicKey).getParams(), ((ECKey) privateKey).getParams()); in assertKeyPairSelfConsistent()
179 + publicKey.getClass().getName(), in assertKeyPairSelfConsistent()
180 publicKey instanceof RSAKey); in assertKeyPairSelfConsistent()
185 ((RSAKey) publicKey).getModulus(), ((RSAKey) privateKey).getModulus()); in assertKeyPairSelfConsistent()
DImportWrappedKeyTest.java305 public byte[] wrapKey(PublicKey publicKey, byte[] keyMaterial, byte[] mask, in wrapKey() argument
325 pkCipher.init(Cipher.ENCRYPT_MODE, publicKey, spec); in wrapKey()
/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/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.java374 void verifySignature(String algoIdentifier, PublicKey publicKey, byte[] signature) in verifySignature() argument
378 verify.initVerify(publicKey); in verifySignature()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DKeyManagementTest.java308 void verifySignature(String algoIdentifier, PublicKey publicKey, byte[] signature) in verifySignature() argument
312 verify.initVerify(publicKey); in verifySignature()
/cts/tests/tests/identity/src/android/security/identity/cts/
DUtil.java518 PublicKey publicKey) throws NoSuchAlgorithmException, InvalidKeyException { in coseSign1CheckSignature() argument
575 verifier.initVerify(publicKey); in coseSign1CheckSignature()