Home
last modified time | relevance | path

Searched refs:keyPair (Results 1 – 7 of 7) 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()
326 KeyPair keyPair = generator.generateKeyPair(); in testGenerateHonorsRequestedAuthorizations() local
327 assertEquals(algorithm, keyPair.getPrivate().getAlgorithm()); in testGenerateHonorsRequestedAuthorizations()
329 KeyInfo keyInfo = TestUtils.getKeyInfo(keyPair.getPrivate()); in testGenerateHonorsRequestedAuthorizations()
381 KeyPair keyPair = generator.generateKeyPair(); in testGenerate_EC_LegacySpec() local
383 keyPair, in testGenerate_EC_LegacySpec()
393 ECCurves.NIST_P_256_SPEC, ((ECPublicKey) keyPair.getPublic()).getParams()); in testGenerate_EC_LegacySpec()
394 KeyInfo keyInfo = TestUtils.getKeyInfo(keyPair.getPrivate()); in testGenerate_EC_LegacySpec()
427 keyPair = generator.generateKeyPair(); in testGenerate_EC_LegacySpec()
[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()
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 …]
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.java80 static void assertKeyPairSelfConsistent(KeyPair keyPair) { in assertKeyPairSelfConsistent() argument
81 assertKeyPairSelfConsistent(keyPair.getPublic(), keyPair.getPrivate()); in assertKeyPairSelfConsistent()
127 static void assertKeySize(int expectedSizeBits, KeyPair keyPair) { in assertKeySize() argument
128 assertEquals(expectedSizeBits, getKeySizeBits(keyPair.getPrivate())); in assertKeySize()
129 assertEquals(expectedSizeBits, getKeySizeBits(keyPair.getPublic())); in assertKeySize()
136 static void assertKeyStoreKeyPair(KeyStore keyStore, String alias, KeyPair keyPair) { in assertKeyStoreKeyPair() argument
137 assertKeyMaterialExportable(keyPair.getPublic()); in assertKeyStoreKeyPair()
138 assertKeyMaterialNotExportable(keyPair.getPrivate()); in assertKeyStoreKeyPair()
139 assertTransparentKey(keyPair.getPublic()); in assertKeyStoreKeyPair()
140 assertOpaqueKey(keyPair.getPrivate()); in assertKeyStoreKeyPair()
[all …]
DKeyInfoTest.java57 KeyPair keyPair = keyPairGenerator.generateKeyPair(); in testImmutabilityViaGetterReturnValues() local
59 PrivateKey key = keyPair.getPrivate(); in testImmutabilityViaGetterReturnValues()