Home
last modified time | relevance | path

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

/cts/tests/tests/keystore/src/android/keystore/cts/
DKeyPairGeneratorTest.java219 KeyPair keyPair = generator.generateKeyPair(); in testDefaultKeySize() local
221 TestUtils.getKeyInfo(keyPair.getPrivate()).getKeySize()); in testDefaultKeySize()
334 KeyPair keyPair = generator.generateKeyPair(); in testGenerateHonorsRequestedAuthorizationsHelper() local
335 assertEquals(algorithm, keyPair.getPrivate().getAlgorithm()); in testGenerateHonorsRequestedAuthorizationsHelper()
337 KeyInfo keyInfo = TestUtils.getKeyInfo(keyPair.getPrivate()); in testGenerateHonorsRequestedAuthorizationsHelper()
390 KeyPair keyPair = generator.generateKeyPair(); in testGenerate_EC_LegacySpec() local
392 keyPair, in testGenerate_EC_LegacySpec()
402 ECCurves.NIST_P_256_SPEC, ((ECPublicKey) keyPair.getPublic()).getParams()); in testGenerate_EC_LegacySpec()
403 KeyInfo keyInfo = TestUtils.getKeyInfo(keyPair.getPrivate()); in testGenerate_EC_LegacySpec()
436 keyPair = generator.generateKeyPair(); in testGenerate_EC_LegacySpec()
[all …]
DSignatureTest.java370 KeyPair keyPair = importDefaultKatKeyPair(sigAlgorithm).getKeystoreBackedKeyPair(); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenSigning() local
372 signature.initSign(keyPair.getPrivate()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenSigning()
386 KeyPair keyPair = importDefaultKatKeyPair(sigAlgorithm).getKeystoreBackedKeyPair(); in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenVerifying() local
388 signature.initVerify(keyPair.getPublic()); in testAndroidKeyStorePublicKeysAcceptedByHighestPriorityProviderWhenVerifying()
406 KeyPair keyPair = key.getKeystoreBackedKeyPair(); in testValidSignatureGeneratedForEmptyMessage() local
410 signature.initSign(keyPair.getPrivate()); in testValidSignatureGeneratedForEmptyMessage()
414 signature.initVerify(keyPair.getPublic()); in testValidSignatureGeneratedForEmptyMessage()
435 KeyPair keyPair = key.getKeystoreBackedKeyPair(); in testEmptySignatureDoesNotVerify() local
437 signature.initVerify(keyPair.getPublic()); in testEmptySignatureDoesNotVerify()
458 KeyPair keyPair = key.getKeystoreBackedKeyPair(); in testSignatureGeneratedByAndroidKeyStoreVerifiesByAndroidKeyStore() local
[all …]
DECDSASignatureTest.java43 private void assertNONEwithECDSATruncatesInputToFieldSize(KeyPair keyPair) in assertNONEwithECDSATruncatesInputToFieldSize() argument
45 int keySizeBits = TestUtils.getKeySizeBits(keyPair.getPublic()); in assertNONEwithECDSATruncatesInputToFieldSize()
52 signature.initSign(keyPair.getPrivate()); in assertNONEwithECDSATruncatesInputToFieldSize()
59 signature.initVerify(keyPair.getPublic()); in assertNONEwithECDSATruncatesInputToFieldSize()
85 private void assertNONEwithECDSASupportsMessagesShorterThanFieldSize(KeyPair keyPair) in assertNONEwithECDSASupportsMessagesShorterThanFieldSize() argument
87 int keySizeBits = TestUtils.getKeySizeBits(keyPair.getPublic()); in assertNONEwithECDSASupportsMessagesShorterThanFieldSize()
94 signature.initSign(keyPair.getPrivate()); in assertNONEwithECDSASupportsMessagesShorterThanFieldSize()
101 signature.initVerify(keyPair.getPublic()); in assertNONEwithECDSASupportsMessagesShorterThanFieldSize()
DKeyFactoryTest.java119 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations() local
121 KeyInfo keyInfo = keyFactory.getKeySpec(keyPair.getPrivate(), KeyInfo.class); in testGetKeySpecWithKeystorePrivateKeyAndKeyInfoReflectsAllAuthorizations()
161 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo() local
164 keyFactory.getKeySpec(keyPair.getPublic(), KeyInfo.class); in testGetKeySpecWithKeystorePublicKeyRejectsKeyInfo()
189 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec() local
193 keyFactory.getKeySpec(keyPair.getPrivate(), transparentKeySpecClass); in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec()
198 keyFactory.getKeySpec(keyPair.getPrivate(), PKCS8EncodedKeySpec.class); in testGetKeySpecWithKeystorePrivateKeyRejectsTransparentKeySpecAndEncodedKeySpec()
214 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec() local
215 PublicKey publicKey = keyPair.getPublic(); in testGetKeySpecWithKeystorePublicKeyAcceptsX509EncodedKeySpec()
234 KeyPair keyPair = keyGenerator.generateKeyPair(); in testGetKeySpecWithKeystorePublicKeyAcceptsTransparentKeySpec() local
[all …]
DRSASignatureTest.java59 for (ImportedKey keyPair : importKatKeyPairs("NONEwithRSA")) { in testMaxMessageSizeWhenNoDigestUsed()
60 PublicKey publicKey = keyPair.getKeystoreBackedKeyPair().getPublic(); in testMaxMessageSizeWhenNoDigestUsed()
61 PrivateKey privateKey = keyPair.getKeystoreBackedKeyPair().getPrivate(); in testMaxMessageSizeWhenNoDigestUsed()
124 KeyPair keyPair = TestUtils.importIntoAndroidKeyStore("test1", in testSmallKeyRejected() local
130 assertEquals(512, ((RSAKey) keyPair.getPrivate()).getModulus().bitLength()); in testSmallKeyRejected()
131 assertEquals(512, ((RSAKey) keyPair.getPublic()).getModulus().bitLength()); in testSmallKeyRejected()
137 signature.initSign(keyPair.getPrivate()); in testSmallKeyRejected()
DTestUtils.java99 static void assertKeyPairSelfConsistent(KeyPair keyPair) { in assertKeyPairSelfConsistent() argument
100 assertKeyPairSelfConsistent(keyPair.getPublic(), keyPair.getPrivate()); in assertKeyPairSelfConsistent()
146 static void assertKeySize(int expectedSizeBits, KeyPair keyPair) { in assertKeySize() argument
147 assertEquals(expectedSizeBits, getKeySizeBits(keyPair.getPrivate())); in assertKeySize()
148 assertEquals(expectedSizeBits, getKeySizeBits(keyPair.getPublic())); in assertKeySize()
155 static void assertKeyStoreKeyPair(KeyStore keyStore, String alias, KeyPair keyPair) { in assertKeyStoreKeyPair() argument
156 assertKeyMaterialExportable(keyPair.getPublic()); in assertKeyStoreKeyPair()
157 assertKeyMaterialNotExportable(keyPair.getPrivate()); in assertKeyStoreKeyPair()
158 assertTransparentKey(keyPair.getPublic()); in assertKeyStoreKeyPair()
159 assertOpaqueKey(keyPair.getPrivate()); in assertKeyStoreKeyPair()
[all …]
DKeyInfoTest.java57 KeyPair keyPair = keyPairGenerator.generateKeyPair(); in testImmutabilityViaGetterReturnValues() local
59 PrivateKey key = keyPair.getPrivate(); in testImmutabilityViaGetterReturnValues()
/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/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DKeyChainTestActivity.java77 void onKeyPairGenerated(AttestedKeyPair keyPair); in onKeyPairGenerated() argument
125 public void onKeyPairGenerated(AttestedKeyPair keyPair) { in onKeyPairGenerated() argument
126 mAttestedKeyPair = keyPair; in onKeyPairGenerated()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DKeyManagementTest.java301 void verifySignatureOverData(String algoIdentifier, KeyPair keyPair) throws Exception { in verifySignatureOverData() argument
302 verifySignature(algoIdentifier, keyPair.getPublic(), in verifySignatureOverData()
303 signDataWithKey(algoIdentifier, keyPair.getPrivate())); in verifySignatureOverData()
491 final KeyPair keyPair = generated.getKeyPair(); in generateKeyAndCheckAttestation() local
492 verifySignatureOverData(signatureAlgorithm, keyPair); in generateKeyAndCheckAttestation()
495 validateSignatureChain(attestation, keyPair.getPublic()); in generateKeyAndCheckAttestation()
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DSecurityLoggingTest.java502 final KeyPair keyPair = generator.generateKeyPair(); in generateKey() local
503 assertNotNull(keyPair); in generateKey()