Home
last modified time | relevance | path

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

/cts/tests/tests/keystore/src/android/keystore/cts/
DSignatureTest.java398 KeyPair keyPair = importDefaultKatKeyPair(sigAlgorithm).getKeystoreBackedKeyPair(); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenSigning() local
400 signature.initSign(keyPair.getPrivate()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenSigning()
415 KeyPair keyPair = importDefaultKatKeyPair(sigAlgorithm).getKeystoreBackedKeyPair(); in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenVerifying() local
417 signature.initVerify(keyPair.getPublic()); in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenVerifying()
436 KeyPair keyPair = key.getKeystoreBackedKeyPair(); in testValidSignatureGeneratedForEmptyMessage() local
440 signature.initSign(keyPair.getPrivate()); in testValidSignatureGeneratedForEmptyMessage()
444 signature.initVerify(keyPair.getPublic()); in testValidSignatureGeneratedForEmptyMessage()
467 KeyPair keyPair = key.getKeystoreBackedKeyPair(); in testValidSignatureGeneratedForEmptyMessageByLimitedUseKey() local
469 keyPair.getPrivate().getAlgorithm(), "AndroidKeyStore"); in testValidSignatureGeneratedForEmptyMessageByLimitedUseKey()
470 KeyInfo info = keyFactory.getKeySpec(keyPair.getPrivate(), KeyInfo.class); in testValidSignatureGeneratedForEmptyMessageByLimitedUseKey()
[all …]
DKeyPairGeneratorTest.java267 KeyPair keyPair = generator.generateKeyPair(); in testDefaultKeySize() local
269 TestUtils.getKeyInfo(keyPair.getPrivate()).getKeySize()); in testDefaultKeySize()
389 KeyPair keyPair = generator.generateKeyPair(); in testGenerateHonorsRequestedAuthorizationsHelper() local
390 assertEquals(algorithm, keyPair.getPrivate().getAlgorithm()); in testGenerateHonorsRequestedAuthorizationsHelper()
392 KeyInfo keyInfo = TestUtils.getKeyInfo(keyPair.getPrivate()); in testGenerateHonorsRequestedAuthorizationsHelper()
446 KeyPair keyPair = generator.generateKeyPair(); in testGenerate_EC_LegacySpec() local
448 keyPair, in testGenerate_EC_LegacySpec()
458 ECCurves.NIST_P_256_SPEC, ((ECPublicKey) keyPair.getPublic()).getParams()); in testGenerate_EC_LegacySpec()
459 KeyInfo keyInfo = TestUtils.getKeyInfo(keyPair.getPrivate()); in testGenerate_EC_LegacySpec()
492 keyPair = generator.generateKeyPair(); in testGenerate_EC_LegacySpec()
[all …]
DKeyFactoryTest.java144 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() local
146 KeyInfo keyInfo = keyFactory.getKeySpec(keyPair.getPrivate(), KeyInfo.class); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations()
187 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() local
190 keyFactory.getKeySpec(keyPair.getPublic(), KeyInfo.class); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo()
216 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec() local
220 keyFactory.getKeySpec(keyPair.getPrivate(), transparentKeySpecClass); in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec()
225 keyFactory.getKeySpec(keyPair.getPrivate(), PKCS8EncodedKeySpec.class); in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec()
242 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec() local
243 PublicKey publicKey = keyPair.getPublic(); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec()
263 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec() local
[all …]
DECDSASignatureTest.java79 private void assertNONEwithECDSATruncatesInputToFieldSize(KeyPair keyPair) in assertNONEwithECDSATruncatesInputToFieldSize() argument
81 int keySizeBits = TestUtils.getKeySizeBits(keyPair.getPublic()); in assertNONEwithECDSATruncatesInputToFieldSize()
97 signature.initSign(keyPair.getPrivate()); in assertNONEwithECDSATruncatesInputToFieldSize()
104 signature.initVerify(keyPair.getPublic()); in assertNONEwithECDSATruncatesInputToFieldSize()
232 private byte[] computeSignatureForNonceReuse_Helper(byte[] message, KeyPair keyPair) in computeSignatureForNonceReuse_Helper() argument
235 signature.initSign(keyPair.getPrivate()); in computeSignatureForNonceReuse_Helper()
241 private void assertNONEwithECDSASupportsMessagesShorterThanFieldSize(KeyPair keyPair) in assertNONEwithECDSASupportsMessagesShorterThanFieldSize() argument
243 int keySizeBits = TestUtils.getKeySizeBits(keyPair.getPublic()); in assertNONEwithECDSASupportsMessagesShorterThanFieldSize()
250 signature.initSign(keyPair.getPrivate()); in assertNONEwithECDSASupportsMessagesShorterThanFieldSize()
257 signature.initVerify(keyPair.getPublic()); in assertNONEwithECDSASupportsMessagesShorterThanFieldSize()
DRSASignatureTest.java75 for (ImportedKey keyPair : importKatKeyPairs("NONEwithRSA")) { in testMaxMessageSizeWhenNoDigestUsed()
76 PublicKey publicKey = keyPair.getKeystoreBackedKeyPair().getPublic(); in testMaxMessageSizeWhenNoDigestUsed()
77 PrivateKey privateKey = keyPair.getKeystoreBackedKeyPair().getPrivate(); in testMaxMessageSizeWhenNoDigestUsed()
142 KeyPair keyPair = TestUtils.importIntoAndroidKeyStore("test1", in testSmallKeyRejected() local
148 assertEquals(512, ((RSAKey) keyPair.getPrivate()).getModulus().bitLength()); in testSmallKeyRejected()
149 assertEquals(512, ((RSAKey) keyPair.getPublic()).getModulus().bitLength()); in testSmallKeyRejected()
155 signature.initSign(keyPair.getPrivate()); in testSmallKeyRejected()
DKeyInfoTest.java81 KeyPair keyPair = keyPairGenerator.generateKeyPair(); in testImmutabilityViaGetterReturnValues() local
83 PrivateKey key = keyPair.getPrivate(); in testImmutabilityViaGetterReturnValues()
150 KeyPair keyPair = keyPairGenerator.generateKeyPair(); in testLimitedUseKey() local
152 PrivateKey key = keyPair.getPrivate(); in testLimitedUseKey()
DDeviceOwnerKeyManagementTest.java141 void verifySignatureOverData(String algoIdentifier, KeyPair keyPair) throws Exception { in verifySignatureOverData() argument
142 verifySignature(algoIdentifier, keyPair.getPublic(), in verifySignatureOverData()
143 signDataWithKey(algoIdentifier, keyPair.getPrivate())); in verifySignatureOverData()
415 final KeyPair keyPair = generated.getKeyPair(); in generateKeyAndCheckAttestation() local
416 verifySignatureOverData(signatureAlgorithm, keyPair); in generateKeyAndCheckAttestation()
419 validateSignatureChain(attestation, keyPair.getPublic()); in generateKeyAndCheckAttestation()
DKeyAgreementTest.java122 KeyPair keyPair = importedKey.getKeystoreBackedKeyPair(); in testGenerateSecret_withImportedKey() local
125 ka.init(keyPair.getPrivate()); in testGenerateSecret_withImportedKey()
DRSACipherTest.java310 KeyPair keyPair = generator.generateKeyPair(); in testRsaOaepDecryptWithWrongMGF1DigestFails() local
316 () -> cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate(), in testRsaOaepDecryptWithWrongMGF1DigestFails()
/cts/tests/security/src/android/keystore/cts/
DCertificateUtils.java36 KeyPair keyPair, X500Principal subject, X500Principal issuer) throws Exception { in createCertificate() argument
56 SubjectPublicKeyInfo.getInstance(keyPair.getPublic().getEncoded())); in createCertificate()
59 String keyAlgorithm = keyPair.getPrivate().getAlgorithm(); in createCertificate()
73 .build(keyPair.getPrivate())); in createCertificate()
/cts/tests/tests/keystore/src/android/keystore/cts/util/
DTestUtils.java278 public static void assertKeyPairSelfConsistent(KeyPair keyPair) { in assertKeyPairSelfConsistent() argument
279 assertKeyPairSelfConsistent(keyPair.getPublic(), keyPair.getPrivate()); in assertKeyPairSelfConsistent()
347 public static void assertKeySize(int expectedSizeBits, KeyPair keyPair) { in assertKeySize() argument
348 assertEquals(expectedSizeBits, getKeySizeBits(keyPair.getPrivate())); in assertKeySize()
349 assertEquals(expectedSizeBits, getKeySizeBits(keyPair.getPublic())); in assertKeySize()
356 public static void assertKeyStoreKeyPair(KeyStore keyStore, String alias, KeyPair keyPair) { in assertKeyStoreKeyPair() argument
357 assertKeyMaterialExportable(keyPair.getPublic()); in assertKeyStoreKeyPair()
358 assertKeyMaterialNotExportable(keyPair.getPrivate()); in assertKeyStoreKeyPair()
359 assertTransparentKey(keyPair.getPublic()); in assertKeyStoreKeyPair()
360 assertOpaqueKey(keyPair.getPrivate()); in assertKeyStoreKeyPair()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DKeyChainTestActivity.java71 void onKeyPairGenerated(AttestedKeyPair keyPair); in onKeyPairGenerated() argument
119 public void onKeyPairGenerated(AttestedKeyPair keyPair) { in onKeyPairGenerated() argument
120 mAttestedKeyPair = keyPair; in onKeyPairGenerated()
/cts/hostsidetests/devicepolicy/app/DelegateApp/src/com/android/cts/delegate/
DSecurityLoggingDelegateTest.java94 final KeyPair keyPair = keyGen.generateKeyPair(); in testGenerateLogs() local
95 assertThat(keyPair).isNotNull(); in testGenerateLogs()
/cts/tests/devicepolicy/src/android/devicepolicy/cts/
DCredentialManagementAppTest.java388 private void verifySignatureOverData(String algoIdentifier, KeyPair keyPair) throws Exception { in verifySignatureOverData() argument
389 verifySignature(algoIdentifier, keyPair.getPublic(), in verifySignatureOverData()
390 signDataWithKey(algoIdentifier, keyPair.getPrivate())); in verifySignatureOverData()
DSecurityLoggingTest.kt774 val keyPair = with(KeyPairGenerator.getInstance("RSA", "AndroidKeyStore")) { in <lambda>() constant
778 assertThat(keyPair).isNotNull() in <lambda>()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DKeyManagementTest.java190 void verifySignatureOverData(String algoIdentifier, KeyPair keyPair) throws Exception { in verifySignatureOverData() argument
191 verifySignature(algoIdentifier, keyPair.getPublic(), in verifySignatureOverData()
192 signDataWithKey(algoIdentifier, keyPair.getPrivate())); in verifySignatureOverData()
390 final KeyPair keyPair = generated.getKeyPair(); in generateKeyAndCheckAttestation() local
391 verifySignatureOverData(signatureAlgorithm, keyPair); in generateKeyAndCheckAttestation()
394 validateSignatureChain(attestation, keyPair.getPublic()); in generateKeyAndCheckAttestation()
DSecurityLoggingTest.java651 final KeyPair keyPair = generator.generateKeyPair(); in generateKey() local
652 assertNotNull(keyPair); in generateKey()