Searched refs:publicKey (Results 1 – 8 of 8) sorted by relevance
/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 | 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 | 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 | 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 | 107 static void assertKeyPairSelfConsistent(PublicKey publicKey, PrivateKey privateKey) { in assertKeyPairSelfConsistent() argument 108 assertNotNull(publicKey); in assertKeyPairSelfConsistent() 110 assertEquals(publicKey.getAlgorithm(), privateKey.getAlgorithm()); in assertKeyPairSelfConsistent() 111 String keyAlgorithm = publicKey.getAlgorithm(); in assertKeyPairSelfConsistent() 114 + publicKey.getClass().getName(), in assertKeyPairSelfConsistent() 115 publicKey instanceof ECKey); in assertKeyPairSelfConsistent() 121 ((ECKey) publicKey).getParams(), ((ECKey) privateKey).getParams()); in assertKeyPairSelfConsistent() 124 + publicKey.getClass().getName(), in assertKeyPairSelfConsistent() 125 publicKey instanceof RSAKey); in assertKeyPairSelfConsistent() 130 ((RSAKey) publicKey).getModulus(), ((RSAKey) privateKey).getModulus()); in assertKeyPairSelfConsistent()
|
D | ImportWrappedKeyTest.java | 304 public byte[] wrapKey(PublicKey publicKey, byte[] keyMaterial, byte[] mask, in wrapKey() argument 323 pkCipher.init(Cipher.ENCRYPT_MODE, publicKey); in wrapKey()
|
/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()
|