/aosp_15_r20/external/conscrypt/testing/src/main/java/org/conscrypt/java/security/ |
H A D | TestKeyStore.java | 519 for (String keyAlgorithm : keyAlgorithms) { in build() 520 String publicAlias = aliasPrefix + "-public-" + keyAlgorithm; in build() 521 String privateAlias = aliasPrefix + "-private-" + keyAlgorithm; in build() 522 if ((keyAlgorithm.equals("EC_RSA") || keyAlgorithm.equals("DH_RSA")) in build() 524 createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, null, in build() 527 } else if (keyAlgorithm.equals("DH_DSA") && signer == null && rootCa == null) { in build() 528 createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, null, in build() 532 createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, privateEntry, in build() 562 private KeyStore createKeys(KeyStore keyStore, String keyAlgorithm, String publicAlias, in createKeys() argument 597 if (keyAlgorithm.equals("RSA")) { in createKeys() [all …]
|
/aosp_15_r20/libcore/support/src/test/java/libcore/java/security/ |
H A D | TestKeyStore.java | 509 for (String keyAlgorithm : keyAlgorithms) { in build() 510 String publicAlias = aliasPrefix + "-public-" + keyAlgorithm; in build() 511 String privateAlias = aliasPrefix + "-private-" + keyAlgorithm; in build() 512 if ((keyAlgorithm.equals("EC_RSA") || keyAlgorithm.equals("DH_RSA")) in build() 514 createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, null, in build() 517 } else if (keyAlgorithm.equals("DH_DSA") && signer == null && rootCa == null) { in build() 518 createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, null, in build() 522 createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, privateEntry, in build() 554 String keyAlgorithm, in createKeys() argument 585 if (keyAlgorithm.equals("RSA")) { in createKeys() [all …]
|
/aosp_15_r20/external/conscrypt/repackaged/testing/src/main/java/com/android/org/conscrypt/java/security/ |
H A D | TestKeyStore.java | 520 for (String keyAlgorithm : keyAlgorithms) { in build() 521 String publicAlias = aliasPrefix + "-public-" + keyAlgorithm; in build() 522 String privateAlias = aliasPrefix + "-private-" + keyAlgorithm; in build() 523 if ((keyAlgorithm.equals("EC_RSA") || keyAlgorithm.equals("DH_RSA")) in build() 525 createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, null, in build() 528 } else if (keyAlgorithm.equals("DH_DSA") && signer == null && rootCa == null) { in build() 529 createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, null, in build() 533 createKeys(keyStore, keyAlgorithm, publicAlias, privateAlias, privateEntry, in build() 563 private KeyStore createKeys(KeyStore keyStore, String keyAlgorithm, String publicAlias, in createKeys() argument 598 if (keyAlgorithm.equals("RSA")) { in createKeys() [all …]
|
/aosp_15_r20/tools/apkzlib/src/main/java/com/android/tools/build/apkzlib/sign/ |
H A D | SignatureAlgorithm.java | 36 @Nonnull public final String keyAlgorithm; field in SignatureAlgorithm 57 … @Nonnull String keyAlgorithm, int minSdkVersion, @Nonnull String signatureAlgorithmSuffix) { in SignatureAlgorithm() 58 this.keyAlgorithm = keyAlgorithm; in SignatureAlgorithm() 74 public static SignatureAlgorithm fromKeyAlgorithm(@Nonnull String keyAlgorithm, in fromKeyAlgorithm() argument 77 if (alg.keyAlgorithm.equalsIgnoreCase(keyAlgorithm)) { in fromKeyAlgorithm() 79 throw new NoSuchAlgorithmException("Signatures with " + keyAlgorithm in fromKeyAlgorithm() 89 throw new NoSuchAlgorithmException("Signing with " + keyAlgorithm in fromKeyAlgorithm()
|
/aosp_15_r20/external/conscrypt/repackaged/testing/src/main/java/com/android/org/conscrypt/javax/net/ssl/ |
H A D | RandomPrivateKeyX509ExtendedKeyManager.java | 50 String keyAlgorithm = originalPrivateKey.getAlgorithm(); in getPrivateKey() local 52 KeyFactory keyFactory = KeyFactory.getInstance(keyAlgorithm); in getPrivateKey() 53 if ("RSA".equals(keyAlgorithm)) { in getPrivateKey() 58 String cacheKey = keyAlgorithm + "-" + keyLengthBits; in getPrivateKey() 61 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm); in getPrivateKey() 66 } else if ("DSA".equals(keyAlgorithm)) { in getPrivateKey() 69 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm); in getPrivateKey() 73 } else if ("EC".equals(keyAlgorithm)) { in getPrivateKey() 74 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm); in getPrivateKey()
|
/aosp_15_r20/libcore/support/src/test/java/libcore/javax/net/ssl/ |
H A D | RandomPrivateKeyX509ExtendedKeyManager.java | 52 String keyAlgorithm = originalPrivateKey.getAlgorithm(); in getPrivateKey() local 54 KeyFactory keyFactory = KeyFactory.getInstance(keyAlgorithm); in getPrivateKey() 55 if ("RSA".equals(keyAlgorithm)) { in getPrivateKey() 60 String cacheKey = keyAlgorithm + "-" + keyLengthBits; in getPrivateKey() 63 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm); in getPrivateKey() 68 } else if ("DSA".equals(keyAlgorithm)) { in getPrivateKey() 71 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm); in getPrivateKey() 75 } else if ("EC".equals(keyAlgorithm)) { in getPrivateKey() 76 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm); in getPrivateKey()
|
/aosp_15_r20/external/conscrypt/testing/src/main/java/org/conscrypt/javax/net/ssl/ |
H A D | RandomPrivateKeyX509ExtendedKeyManager.java | 48 String keyAlgorithm = originalPrivateKey.getAlgorithm(); in getPrivateKey() local 50 KeyFactory keyFactory = KeyFactory.getInstance(keyAlgorithm); in getPrivateKey() 51 if ("RSA".equals(keyAlgorithm)) { in getPrivateKey() 56 String cacheKey = keyAlgorithm + "-" + keyLengthBits; in getPrivateKey() 59 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm); in getPrivateKey() 64 } else if ("DSA".equals(keyAlgorithm)) { in getPrivateKey() 67 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm); in getPrivateKey() 71 } else if ("EC".equals(keyAlgorithm)) { in getPrivateKey() 72 KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(keyAlgorithm); in getPrivateKey()
|
/aosp_15_r20/cts/tests/tests/keystore/src/android/keystore/cts/util/ |
H A D | TestUtils.java | 287 String keyAlgorithm = publicKey.getAlgorithm(); in assertKeyPairSelfConsistent() local 288 if ("EC".equalsIgnoreCase(keyAlgorithm)) { in assertKeyPairSelfConsistent() 298 } else if ("RSA".equalsIgnoreCase(keyAlgorithm)) { in assertKeyPairSelfConsistent() 307 } else if ("XDH".equalsIgnoreCase(keyAlgorithm)) { in assertKeyPairSelfConsistent() 330 fail("Unsuported key algorithm: " + keyAlgorithm); in assertKeyPairSelfConsistent() 786 … public static KeyPair getKeyPairForKeyAlgorithm(String keyAlgorithm, Iterable<KeyPair> keyPairs) { in getKeyPairForKeyAlgorithm() argument 788 if (keyAlgorithm.equalsIgnoreCase(keyPair.getPublic().getAlgorithm())) { in getKeyPairForKeyAlgorithm() 792 throw new IllegalArgumentException("No KeyPair for key algorithm " + keyAlgorithm); in getKeyPairForKeyAlgorithm() 795 public static Key getKeyForKeyAlgorithm(String keyAlgorithm, Iterable<? extends Key> keys) { in getKeyForKeyAlgorithm() argument 797 if (keyAlgorithm.equalsIgnoreCase(key.getAlgorithm())) { in getKeyForKeyAlgorithm() [all …]
|
/aosp_15_r20/cts/tests/tests/keystore/src/android/keystore/cts/ |
H A D | DeviceOwnerKeyManagementTest.java | 84 public final String keyAlgorithm; field in DeviceOwnerKeyManagementTest.SupportedKeyAlgorithm 89 String keyAlgorithm, String signatureAlgorithm, in SupportedKeyAlgorithm() argument 91 this.keyAlgorithm = keyAlgorithm; in SupportedKeyAlgorithm() 357 String keyAlgorithm, String signatureAlgorithm, in generateKeyAndCheckAttestation() argument 361 String.format("com.android.test.attested-%s", keyAlgorithm.toLowerCase()); in generateKeyAndCheckAttestation() 376 DEVICE_ADMIN_COMPONENT_NAME, keyAlgorithm, spec, deviceIdAttestationFlags); in generateKeyAndCheckAttestation() 387 keyAlgorithm, deviceIdAttestationFlags)) in generateKeyAndCheckAttestation() 398 keyAlgorithm, deviceIdAttestationFlags)) in generateKeyAndCheckAttestation() 410 keyAlgorithm)) in generateKeyAndCheckAttestation() 428 keyAlgorithm, deviceIdAttestationFlags, ex)) in generateKeyAndCheckAttestation() [all …]
|
H A D | MacTest.java | 616 String macAlgorithm, String keyAlgorithm, KeyProtection keyProtection) in assertInitSucceeds() argument 618 SecretKey key = importDefaultKatKey(keyAlgorithm, keyProtection); in assertInitSucceeds() 629 String macAlgorithm, String keyAlgorithm, KeyProtection keyProtection) in assertInitThrowsInvalidKeyException() argument 631 SecretKey key = importDefaultKatKey(keyAlgorithm, keyProtection); in assertInitThrowsInvalidKeyException() 636 + ", key algorithm: " + keyAlgorithm); in assertInitThrowsInvalidKeyException() 640 private SecretKey getDefaultKatKey(String keyAlgorithm) { in getDefaultKatKey() argument 641 return new SecretKeySpec(KAT_KEY, keyAlgorithm); in getDefaultKatKey() 644 private SecretKey importDefaultKatKey(String keyAlgorithm) throws Exception { in importDefaultKatKey() argument 646 keyAlgorithm, in importDefaultKatKey() 651 String keyAlgorithm, KeyProtection keyProtection) throws Exception { in importDefaultKatKey() argument [all …]
|
H A D | SignatureTest.java | 766 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(algorithm); in testLongMsgKat() local 768 && (!KeyProperties.KEY_ALGORITHM_EC.equalsIgnoreCase(keyAlgorithm))) { in testLongMsgKat() 1204 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(signatureAlgorithm); in getDefaultKeyAndCertResIds() local 1205 if (KeyProperties.KEY_ALGORITHM_EC.equalsIgnoreCase(keyAlgorithm)) { in getDefaultKeyAndCertResIds() 1207 } else if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyAlgorithm)) { in getDefaultKeyAndCertResIds() 1210 throw new IllegalArgumentException("Unknown key algorithm: " + keyAlgorithm); in getDefaultKeyAndCertResIds() 1215 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(signatureAlgorithm); in importDefaultKatKeyPair() local 1218 if (KeyProperties.KEY_ALGORITHM_EC.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKeyPair() 1225 } else if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKeyPair() 1233 throw new IllegalArgumentException("Unsupported key algorithm: " + keyAlgorithm); in importDefaultKatKeyPair() [all …]
|
H A D | CipherTest.java | 1836 String keyAlgorithm = TestUtils.getCipherKeyAlgorithm(transformation); in getWorkingDecryptionParameterSpec() local 1837 if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyAlgorithm)) { in getWorkingDecryptionParameterSpec() 1839 } else if (KeyProperties.KEY_ALGORITHM_AES.equalsIgnoreCase(keyAlgorithm)) { in getWorkingDecryptionParameterSpec() 1854 } else if (KeyProperties.KEY_ALGORITHM_3DES.equalsIgnoreCase(keyAlgorithm)) { in getWorkingDecryptionParameterSpec() 1865 throw new IllegalArgumentException("Unsupported key algorithm: " + keyAlgorithm); in getWorkingDecryptionParameterSpec() 1912 String keyAlgorithm = TestUtils.getCipherKeyAlgorithm(transformation); in importDefaultKatKey() local 1913 if (KeyProperties.KEY_ALGORITHM_AES.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKey() 1918 } else if (KeyProperties.KEY_ALGORITHM_3DES.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKey() 1923 } else if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKey() 1931 throw new IllegalArgumentException("Unsupported key algorithm: " + keyAlgorithm); in importDefaultKatKey() [all …]
|
/aosp_15_r20/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/ |
H A D | KeyManagementTest.java | 97 public final String keyAlgorithm; field in KeyManagementTest.SupportedKeyAlgorithm 102 String keyAlgorithm, String signatureAlgorithm, in SupportedKeyAlgorithm() argument 104 this.keyAlgorithm = keyAlgorithm; in SupportedKeyAlgorithm() 340 String keyAlgorithm, String signatureAlgorithm, in generateKeyAndCheckAttestation() argument 344 String.format("com.android.test.attested-%s", keyAlgorithm.toLowerCase()); in generateKeyAndCheckAttestation() 359 getWho(), keyAlgorithm, spec, deviceIdAttestationFlags); in generateKeyAndCheckAttestation() 368 keyAlgorithm, deviceIdAttestationFlags)) in generateKeyAndCheckAttestation() 377 keyAlgorithm, deviceIdAttestationFlags)) in generateKeyAndCheckAttestation() 386 keyAlgorithm)) in generateKeyAndCheckAttestation() 400 keyAlgorithm, deviceIdAttestationFlags, ex)) in generateKeyAndCheckAttestation() [all …]
|
/aosp_15_r20/external/conscrypt/common/src/main/java/org/conscrypt/ |
H A D | KeyManagerImpl.java | 168 for (String keyAlgorithm : keyTypes) { in chooseAlias() 169 if (keyAlgorithm == null) { in chooseAlias() 174 int index = keyAlgorithm.indexOf('_'); in chooseAlias() 178 sigAlgorithm = keyAlgorithm.substring(index + 1); in chooseAlias() 179 keyAlgorithm = keyAlgorithm.substring(0, index); in chooseAlias() 182 if (!certKeyAlg.equals(keyAlgorithm)) { in chooseAlias()
|
H A D | CryptoUpcalls.java | 63 String keyAlgorithm = javaKey.getAlgorithm(); in ecSignDigestWithPrivateKey() local 64 if (!"EC".equals(keyAlgorithm)) { in ecSignDigestWithPrivateKey() 148 String keyAlgorithm = javaKey.getAlgorithm(); in rsaOpWithPrivateKey() local 149 if (!"RSA".equals(keyAlgorithm)) { in rsaOpWithPrivateKey() 150 logger.warning("Unexpected key type: " + keyAlgorithm); in rsaOpWithPrivateKey()
|
/aosp_15_r20/external/conscrypt/repackaged/common/src/main/java/com/android/org/conscrypt/ |
H A D | KeyManagerImpl.java | 170 for (String keyAlgorithm : keyTypes) { in chooseAlias() 171 if (keyAlgorithm == null) { in chooseAlias() 176 int index = keyAlgorithm.indexOf('_'); in chooseAlias() 180 sigAlgorithm = keyAlgorithm.substring(index + 1); in chooseAlias() 181 keyAlgorithm = keyAlgorithm.substring(0, index); in chooseAlias() 184 if (!certKeyAlg.equals(keyAlgorithm)) { in chooseAlias()
|
H A D | CryptoUpcalls.java | 65 String keyAlgorithm = javaKey.getAlgorithm(); in ecSignDigestWithPrivateKey() local 66 if (!"EC".equals(keyAlgorithm)) { in ecSignDigestWithPrivateKey() 150 String keyAlgorithm = javaKey.getAlgorithm(); in rsaOpWithPrivateKey() local 151 if (!"RSA".equals(keyAlgorithm)) { in rsaOpWithPrivateKey() 152 logger.warning("Unexpected key type: " + keyAlgorithm); in rsaOpWithPrivateKey()
|
/aosp_15_r20/tools/apksig/src/main/java/com/android/apksig/internal/pkcs7/ |
H A D | AlgorithmIdentifier.java | 83 String keyAlgorithm = publicKey.getAlgorithm(); in getSignerInfoSignatureAlgorithm() local 96 if ("RSA".equalsIgnoreCase(keyAlgorithm) || OID_RSA_ENCRYPTION.equals(keyAlgorithm)) { in getSignerInfoSignatureAlgorithm() 100 } else if ("DSA".equalsIgnoreCase(keyAlgorithm)) { in getSignerInfoSignatureAlgorithm() 123 } else if ("EC".equalsIgnoreCase(keyAlgorithm)) { in getSignerInfoSignatureAlgorithm() 128 throw new InvalidKeyException("Unsupported key algorithm: " + keyAlgorithm); in getSignerInfoSignatureAlgorithm()
|
/aosp_15_r20/cts/tests/security/src/android/keystore/cts/ |
H A D | CertificateUtils.java | 59 String keyAlgorithm = keyPair.getPrivate().getAlgorithm(); in createCertificate() local 61 if (keyAlgorithm.equals("RSA")) { in createCertificate() 63 } else if (keyAlgorithm.equals("EC")) { in createCertificate() 66 throw new IllegalArgumentException("Unknown key algorithm " + keyAlgorithm); in createCertificate()
|
/aosp_15_r20/tools/apksig/src/test/java/com/android/apksig/internal/util/ |
H A D | Resources.java | 146 String keyAlgorithm = resourceName.substring(0, delimiterIndex).toUpperCase(Locale.US); in toPrivateKey() local 147 return toPrivateKey(cls, resourceName, keyAlgorithm); in toPrivateKey() 151 Class <?> cls, String resourceName, String keyAlgorithm) in toPrivateKey() argument 158 switch (keyAlgorithm.toUpperCase(Locale.US)) { in toPrivateKey() 169 throw new InvalidKeySpecException("Unsupported key algorithm: " + keyAlgorithm); in toPrivateKey()
|
/aosp_15_r20/libcore/benchmarks/src/benchmarks/regression/ |
H A D | SignatureBenchmark.java | 70 String keyAlgorithm = signatureAlgorithm.substring(signatureAlgorithm.length() - 3 , in setUp() local 72 KeyPair keyPair = KEY_PAIRS.get(keyAlgorithm); in setUp() 74 KeyPairGenerator generator = KeyPairGenerator.getInstance(keyAlgorithm); in setUp() 76 KEY_PAIRS.put(keyAlgorithm, keyPair); in setUp()
|
/aosp_15_r20/tools/apksig/src/main/java/com/android/apksig/internal/apk/v2/ |
H A D | V2SchemeSigner.java | 93 String keyAlgorithm = signingKey.getAlgorithm(); in getSuggestedSignatureAlgorithms() local 94 if ("RSA".equalsIgnoreCase(keyAlgorithm)) { in getSuggestedSignatureAlgorithms() 114 } else if ("DSA".equalsIgnoreCase(keyAlgorithm)) { in getSuggestedSignatureAlgorithms() 125 } else if ("EC".equalsIgnoreCase(keyAlgorithm)) { in getSuggestedSignatureAlgorithms() 142 throw new InvalidKeyException("Unsupported key algorithm: " + keyAlgorithm); in getSuggestedSignatureAlgorithms()
|
/aosp_15_r20/frameworks/base/apct-tests/perftests/core/src/android/libcore/regression/ |
H A D | SignaturePerfTest.java | 94 String keyAlgorithm = in setUp() local 97 KeyPair keyPair = sKeyPairs.get(keyAlgorithm); in setUp() 99 KeyPairGenerator generator = KeyPairGenerator.getInstance(keyAlgorithm); in setUp() 101 sKeyPairs.put(keyAlgorithm, keyPair); in setUp()
|
/aosp_15_r20/tools/apksig/src/main/java/com/android/apksig/internal/apk/v1/ |
H A D | V1SchemeSigner.java | 127 String keyAlgorithm = signingKey.getAlgorithm(); in getSuggestedSignatureDigestAlgorithm() local 128 if ("RSA".equalsIgnoreCase(keyAlgorithm) || OID_RSA_ENCRYPTION.equals((keyAlgorithm))) { in getSuggestedSignatureDigestAlgorithm() 134 } else if ("DSA".equalsIgnoreCase(keyAlgorithm)) { in getSuggestedSignatureDigestAlgorithm() 141 } else if ("EC".equalsIgnoreCase(keyAlgorithm)) { in getSuggestedSignatureDigestAlgorithm() 148 throw new InvalidKeyException("Unsupported key algorithm: " + keyAlgorithm); in getSuggestedSignatureDigestAlgorithm()
|
/aosp_15_r20/external/wycheproof/keystore-cts/java/android/keystore/cts/util/ |
H A D | KeyStoreUtil.java | 153 String keyAlgorithm = keyPair.getPrivate().getAlgorithm(); in createCertificate() local 155 if (keyAlgorithm.equals("RSA")) { in createCertificate() 157 } else if (keyAlgorithm.equals("EC")) { in createCertificate() 160 throw new IllegalArgumentException("Unknown key algorithm " + keyAlgorithm); in createCertificate()
|