/cts/tests/tests/keystore/src/android/keystore/cts/ |
D | RSACipherTest.java | 49 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 …]
|
D | KeyFactoryTest.java | 215 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()
|
D | RSASignatureTest.java | 60 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()
|
D | SignatureTest.java | 501 PublicKey publicKey = key.getOriginalKeyPair().getPublic(); in testSignatureGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider() local 504 signature.initVerify(publicKey); in testSignatureGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider() 511 sigAlgorithm, verificationProvider, publicKey, message, sigBytes); in testSignatureGeneratedByAndroidKeyStoreVerifiesByHighestPriorityProvider() 1080 PublicKey publicKey = TestUtils.importIntoAndroidKeyStore( in assertInitVerifySucceeds() local 1085 signature.initVerify(publicKey); in assertInitVerifySucceeds() 1184 PublicKey publicKey, in assertSignatureVerifiesOneShot() argument 1187 assertSignatureVerifiesOneShot(algorithm, null, publicKey, message, signature); in assertSignatureVerifiesOneShot() 1193 PublicKey publicKey, in assertSignatureVerifiesOneShot() argument 1198 sig.initVerify(publicKey); in assertSignatureVerifiesOneShot() 1211 PublicKey publicKey, in assertSignatureDoesNotVerifyOneShot() argument [all …]
|
D | AndroidKeyStoreTest.java | 1916 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 …]
|
D | TestUtils.java | 109 static void assertKeyPairSelfConsistent(PublicKey publicKey, PrivateKey privateKey) { in assertKeyPairSelfConsistent() argument 110 assertNotNull(publicKey); in assertKeyPairSelfConsistent() 112 assertEquals(publicKey.getAlgorithm(), privateKey.getAlgorithm()); in assertKeyPairSelfConsistent() 113 String keyAlgorithm = publicKey.getAlgorithm(); in assertKeyPairSelfConsistent() 116 + publicKey.getClass().getName(), in assertKeyPairSelfConsistent() 117 publicKey instanceof ECKey); in assertKeyPairSelfConsistent() 123 ((ECKey) publicKey).getParams(), ((ECKey) privateKey).getParams()); in assertKeyPairSelfConsistent() 126 + publicKey.getClass().getName(), in assertKeyPairSelfConsistent() 127 publicKey instanceof RSAKey); in assertKeyPairSelfConsistent() 132 ((RSAKey) publicKey).getModulus(), ((RSAKey) privateKey).getModulus()); in assertKeyPairSelfConsistent()
|
D | ImportWrappedKeyTest.java | 305 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/ |
D | ImsiEncryptionInfoTest.java | 57 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/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/ |
D | KeyManagementTest.java | 292 void verifySignature(String algoIdentifier, PublicKey publicKey, byte[] signature) in verifySignature() argument 296 verify.initVerify(publicKey); in verifySignature()
|
/cts/tests/tests/identity/src/android/security/identity/cts/ |
D | Util.java | 478 PublicKey publicKey) throws NoSuchAlgorithmException, InvalidKeyException { in coseSign1CheckSignature() argument 535 verifier.initVerify(publicKey); in coseSign1CheckSignature()
|