Home
last modified time | relevance | path

Searched refs:keyAlgorithm (Results 1 – 7 of 7) sorted by relevance

/cts/tests/security/src/android/keystore/cts/
DCertificateUtils.java59 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()
/cts/tests/tests/keystore/src/android/keystore/cts/
DTestUtils.java166 String keyAlgorithm = publicKey.getAlgorithm(); in assertKeyPairSelfConsistent() local
167 if ("EC".equalsIgnoreCase(keyAlgorithm)) { in assertKeyPairSelfConsistent()
177 } else if ("RSA".equalsIgnoreCase(keyAlgorithm)) { in assertKeyPairSelfConsistent()
187 fail("Unsuported key algorithm: " + keyAlgorithm); in assertKeyPairSelfConsistent()
632 static KeyPair getKeyPairForKeyAlgorithm(String keyAlgorithm, Iterable<KeyPair> keyPairs) { in getKeyPairForKeyAlgorithm() argument
634 if (keyAlgorithm.equalsIgnoreCase(keyPair.getPublic().getAlgorithm())) { in getKeyPairForKeyAlgorithm()
638 throw new IllegalArgumentException("No KeyPair for key algorithm " + keyAlgorithm); in getKeyPairForKeyAlgorithm()
641 static Key getKeyForKeyAlgorithm(String keyAlgorithm, Iterable<? extends Key> keys) { in getKeyForKeyAlgorithm() argument
643 if (keyAlgorithm.equalsIgnoreCase(key.getAlgorithm())) { in getKeyForKeyAlgorithm()
647 throw new IllegalArgumentException("No Key for key algorithm " + keyAlgorithm); in getKeyForKeyAlgorithm()
[all …]
DMacTest.java549 String macAlgorithm, String keyAlgorithm, KeyProtection keyProtection) in assertInitSucceeds() argument
551 SecretKey key = importDefaultKatKey(keyAlgorithm, keyProtection); in assertInitSucceeds()
562 String macAlgorithm, String keyAlgorithm, KeyProtection keyProtection) in assertInitThrowsInvalidKeyException() argument
564 SecretKey key = importDefaultKatKey(keyAlgorithm, keyProtection); in assertInitThrowsInvalidKeyException()
569 + ", key algorithm: " + keyAlgorithm); in assertInitThrowsInvalidKeyException()
573 private SecretKey getDefaultKatKey(String keyAlgorithm) { in getDefaultKatKey() argument
574 return new SecretKeySpec(KAT_KEY, keyAlgorithm); in getDefaultKatKey()
577 private SecretKey importDefaultKatKey(String keyAlgorithm) throws Exception { in importDefaultKatKey() argument
579 keyAlgorithm, in importDefaultKatKey()
584 String keyAlgorithm, KeyProtection keyProtection) throws Exception { in importDefaultKatKey() argument
[all …]
DSignatureTest.java733 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(algorithm); in testLongMsgKat() local
735 && (!KeyProperties.KEY_ALGORITHM_EC.equalsIgnoreCase(keyAlgorithm))) { in testLongMsgKat()
1156 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(signatureAlgorithm); in getDefaultKeyAndCertResIds() local
1157 if (KeyProperties.KEY_ALGORITHM_EC.equalsIgnoreCase(keyAlgorithm)) { in getDefaultKeyAndCertResIds()
1159 } else if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyAlgorithm)) { in getDefaultKeyAndCertResIds()
1162 throw new IllegalArgumentException("Unknown key algorithm: " + keyAlgorithm); in getDefaultKeyAndCertResIds()
1167 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(signatureAlgorithm); in importDefaultKatKeyPair() local
1170 if (KeyProperties.KEY_ALGORITHM_EC.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKeyPair()
1177 } else if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKeyPair()
1185 throw new IllegalArgumentException("Unsupported key algorithm: " + keyAlgorithm); in importDefaultKatKeyPair()
[all …]
DCipherTest.java1668 String keyAlgorithm = TestUtils.getCipherKeyAlgorithm(transformation); in getWorkingDecryptionParameterSpec() local
1669 if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyAlgorithm)) { in getWorkingDecryptionParameterSpec()
1671 } else if (KeyProperties.KEY_ALGORITHM_AES.equalsIgnoreCase(keyAlgorithm)) { in getWorkingDecryptionParameterSpec()
1686 } else if (KeyProperties.KEY_ALGORITHM_3DES.equalsIgnoreCase(keyAlgorithm)) { in getWorkingDecryptionParameterSpec()
1697 throw new IllegalArgumentException("Unsupported key algorithm: " + keyAlgorithm); in getWorkingDecryptionParameterSpec()
1744 String keyAlgorithm = TestUtils.getCipherKeyAlgorithm(transformation); in importDefaultKatKey() local
1745 if (KeyProperties.KEY_ALGORITHM_AES.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKey()
1750 } else if (KeyProperties.KEY_ALGORITHM_3DES.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKey()
1755 } else if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyAlgorithm)) { in importDefaultKatKey()
1763 throw new IllegalArgumentException("Unsupported key algorithm: " + keyAlgorithm); in importDefaultKatKey()
[all …]
DRSASignatureTest.java47 String keyAlgorithm = TestUtils.getSignatureAlgorithmKeyAlgorithm(algorithm);
48 if (KeyProperties.KEY_ALGORITHM_RSA.equalsIgnoreCase(keyAlgorithm)) {
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DKeyManagementTest.java97 public final String keyAlgorithm; field in KeyManagementTest.SupportedKeyAlgorithm
102 String keyAlgorithm, String signatureAlgorithm, in SupportedKeyAlgorithm() argument
104 this.keyAlgorithm = keyAlgorithm; in SupportedKeyAlgorithm()
449 String keyAlgorithm, String signatureAlgorithm, in generateKeyAndCheckAttestation() argument
453 String.format("com.android.test.attested-%s", keyAlgorithm.toLowerCase()); in generateKeyAndCheckAttestation()
468 getWho(), keyAlgorithm, spec, deviceIdAttestationFlags); in generateKeyAndCheckAttestation()
477 keyAlgorithm, deviceIdAttestationFlags)) in generateKeyAndCheckAttestation()
486 keyAlgorithm, deviceIdAttestationFlags)) in generateKeyAndCheckAttestation()
495 keyAlgorithm)) in generateKeyAndCheckAttestation()
509 keyAlgorithm, deviceIdAttestationFlags, ex)) in generateKeyAndCheckAttestation()
[all …]