/cts/tests/tests/keystore/src/android/keystore/cts/ |
D | KeyPairGeneratorTest.java | 221 KeyPair keyPair = generator.generateKeyPair(); in testDefaultKeySize() local 223 TestUtils.getKeyInfo(keyPair.getPrivate()).getKeySize()); in testDefaultKeySize() 336 KeyPair keyPair = generator.generateKeyPair(); in testGenerateHonorsRequestedAuthorizationsHelper() local 337 assertEquals(algorithm, keyPair.getPrivate().getAlgorithm()); in testGenerateHonorsRequestedAuthorizationsHelper() 339 KeyInfo keyInfo = TestUtils.getKeyInfo(keyPair.getPrivate()); in testGenerateHonorsRequestedAuthorizationsHelper() 392 KeyPair keyPair = generator.generateKeyPair(); in testGenerate_EC_LegacySpec() local 394 keyPair, in testGenerate_EC_LegacySpec() 404 ECCurves.NIST_P_256_SPEC, ((ECPublicKey) keyPair.getPublic()).getParams()); in testGenerate_EC_LegacySpec() 405 KeyInfo keyInfo = TestUtils.getKeyInfo(keyPair.getPrivate()); in testGenerate_EC_LegacySpec() 438 keyPair = generator.generateKeyPair(); in testGenerate_EC_LegacySpec() [all …]
|
D | SignatureTest.java | 370 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 …]
|
D | ECDSASignatureTest.java | 43 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()
|
D | KeyFactoryTest.java | 119 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 …]
|
D | RSASignatureTest.java | 59 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()
|
D | TestUtils.java | 101 static void assertKeyPairSelfConsistent(KeyPair keyPair) { in assertKeyPairSelfConsistent() argument 102 assertKeyPairSelfConsistent(keyPair.getPublic(), keyPair.getPrivate()); in assertKeyPairSelfConsistent() 148 static void assertKeySize(int expectedSizeBits, KeyPair keyPair) { in assertKeySize() argument 149 assertEquals(expectedSizeBits, getKeySizeBits(keyPair.getPrivate())); in assertKeySize() 150 assertEquals(expectedSizeBits, getKeySizeBits(keyPair.getPublic())); in assertKeySize() 157 static void assertKeyStoreKeyPair(KeyStore keyStore, String alias, KeyPair keyPair) { in assertKeyStoreKeyPair() argument 158 assertKeyMaterialExportable(keyPair.getPublic()); in assertKeyStoreKeyPair() 159 assertKeyMaterialNotExportable(keyPair.getPrivate()); in assertKeyStoreKeyPair() 160 assertTransparentKey(keyPair.getPublic()); in assertKeyStoreKeyPair() 161 assertOpaqueKey(keyPair.getPrivate()); in assertKeyStoreKeyPair() [all …]
|
D | KeyInfoTest.java | 57 KeyPair keyPair = keyPairGenerator.generateKeyPair(); in testImmutabilityViaGetterReturnValues() local 59 PrivateKey key = keyPair.getPrivate(); in testImmutabilityViaGetterReturnValues()
|
/cts/tests/tests/identity/src/android/security/identity/cts/ |
D | UtilUnitTests.java | 271 KeyPair keyPair = coseGenerateKeyPair(); in coseSignAndVerify() local 274 byte[] sig = Util.coseSign1Sign(keyPair.getPrivate(), data, detachedContent, null); in coseSignAndVerify() 275 assertTrue(Util.coseSign1CheckSignature(sig, detachedContent, keyPair.getPublic())); in coseSignAndVerify() 282 KeyPair keyPair = coseGenerateKeyPair(); in coseSignAndVerifyDetachedContent() local 285 byte[] sig = Util.coseSign1Sign(keyPair.getPrivate(), data, detachedContent, null); in coseSignAndVerifyDetachedContent() 286 assertTrue(Util.coseSign1CheckSignature(sig, detachedContent, keyPair.getPublic())); in coseSignAndVerifyDetachedContent() 293 KeyPair keyPair = coseGenerateKeyPair(); in coseSignAndVerifySingleCertificate() local 298 byte[] sig = Util.coseSign1Sign(keyPair.getPrivate(), data, detachedContent, certs); in coseSignAndVerifySingleCertificate() 299 assertTrue(Util.coseSign1CheckSignature(sig, detachedContent, keyPair.getPublic())); in coseSignAndVerifySingleCertificate() 306 KeyPair keyPair = coseGenerateKeyPair(); in coseSignAndVerifyMultipleCertificates() local [all …]
|
D | Util.java | 1251 KeyPair keyPair = kpg.generateKeyPair(); in createEphemeralKeyPair() local 1252 return keyPair; in createEphemeralKeyPair()
|
/cts/tests/security/src/android/keystore/cts/ |
D | CertificateUtils.java | 36 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/ |
D | KeyChainTestActivity.java | 77 void onKeyPairGenerated(AttestedKeyPair keyPair); in onKeyPairGenerated() argument 125 public void onKeyPairGenerated(AttestedKeyPair keyPair) { in onKeyPairGenerated() argument 126 mAttestedKeyPair = keyPair; in onKeyPairGenerated()
|
/cts/tests/tests/net/src/android/net/cts/ |
D | Ikev2VpnTest.java | 520 final KeyPair keyPair = keyPairGenerator.generateKeyPair(); in generateRandomCertAndKeyPair() local 529 certGen.setPublicKey(keyPair.getPublic()); in generateRandomCertAndKeyPair() 532 final X509Certificate cert = certGen.generate(keyPair.getPrivate(), "AndroidOpenSSL"); in generateRandomCertAndKeyPair() 533 return new CertificateAndKey(cert, keyPair.getPrivate()); in generateRandomCertAndKeyPair()
|
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/ |
D | KeyManagementTest.java | 301 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/ |
D | SecurityLoggingTest.java | 506 final KeyPair keyPair = generator.generateKeyPair(); in generateKey() local 507 assertNotNull(keyPair); in generateKey()
|