Home
last modified time | relevance | path

Searched refs:cert (Results 1 – 25 of 87) sorted by relevance

1234

/cts/tools/utils/
Dcertificates.py22 cert = None variable in Certificate
24 def __init__(self, cert, key): argument
25 self.cert = cert
29 return crypto.dump_certificate(crypto.FILETYPE_PEM, self.cert)
47 cert = crypto.load_certificate(crypto.FILETYPE_PEM, data)
49 return Certificate(cert, key)
59 cert = crypto.X509()
60 cert.set_pubkey(key)
61 cert.set_version(2)
62 cert.set_serial_number(random.randint(0, 2**20))
[all …]
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/src/com/android/cts/deviceandprofileowner/
DDelegatedCertInstallerTest.java39 import java.security.cert.Certificate;
40 import java.security.cert.CertificateFactory;
190 final byte[] cert = TEST_CA.getBytes(); in testCaCertsOperations()
192 .generateCertificate(new ByteArrayInputStream(cert)); in testCaCertsOperations()
203 installCaCert(cert); in testCaCertsOperations()
206 ADMIN_RECEIVER_COMPONENT, cert)); in testCaCertsOperations()
209 verifyCaCert(cert); in testCaCertsOperations()
218 removeCaCert(cert); in testCaCertsOperations()
221 ADMIN_RECEIVER_COMPONENT, cert)); in testCaCertsOperations()
231 installCaCert(cert); in testCaCertsOperations()
[all …]
DKeyManagementTest.java57 import java.security.cert.Certificate;
58 import java.security.cert.CertificateException;
59 import java.security.cert.CertificateFactory;
60 import java.security.cert.CertificateParsingException;
61 import java.security.cert.X509Certificate;
115 final Certificate cert = getCertificate(FAKE_RSA_1.caCertificate); in testCanInstallAndRemoveValidRsaKeypair() local
118 assertThat(mDevicePolicyManager.installKeyPair(getWho(), privKey, cert, alias)).isTrue(); in testCanInstallAndRemoveValidRsaKeypair() local
139 final Certificate cert = getCertificate(FAKE_RSA_1.caCertificate); in testCanInstallWithAutomaticAccess() local
144 getWho(), privKey, new Certificate[] {cert}, grant, true)) in testCanInstallWithAutomaticAccess()
148 getWho(), privKey, new Certificate[] {cert}, withhold, false)) in testCanInstallWithAutomaticAccess()
[all …]
DCaCertManagementTest.java24 import java.security.cert.Certificate;
25 import java.security.cert.CertificateException;
26 import java.security.cert.CertificateFactory;
27 import java.security.cert.X509Certificate;
/cts/hostsidetests/devicepolicy/app/DelegateApp/src/com/android/cts/delegate/
DCertInstallDelegateTest.java37 import java.security.cert.Certificate;
38 import java.security.cert.CertificateException;
39 import java.security.cert.CertificateFactory;
140 byte[] cert = TEST_CA.getBytes(); in testCanAccessApis()
143 assertTrue("Certificate installation failed", mDpm.installCaCert(null, cert)); in testCanAccessApis()
146 assertTrue("Certificate is not installed properly", mDpm.hasCaCertInstalled(null, cert)); in testCanAccessApis()
150 containsCertificate(mDpm.getInstalledCaCerts(null), cert)); in testCanAccessApis()
153 mDpm.uninstallCaCert(null, cert); in testCanAccessApis()
154 assertFalse("Certificate was not uninstalled", mDpm.hasCaCertInstalled(null, cert)); in testCanAccessApis()
178 Certificate cert = readCertificate(certBuffer); in containsCertificate() local
[all …]
/cts/hostsidetests/devicepolicy/app/CertInstaller/src/com/android/cts/certinstaller/
DDirectDelegatedCertInstallerTest.java42 import java.security.cert.Certificate;
43 import java.security.cert.CertificateException;
44 import java.security.cert.CertificateFactory;
134 final byte[] cert = TEST_CA.getBytes(); in testCaCertsOperations()
136 .generateCertificate(new ByteArrayInputStream(cert)); in testCaCertsOperations()
144 + " beginning of the test").that(mDpm.hasCaCertInstalled(null, cert)).isFalse(); in testCaCertsOperations()
148 mDpm.installCaCert(null, cert)).isTrue(); in testCaCertsOperations()
150 mDpm.hasCaCertInstalled(null, cert)).isTrue(); in testCaCertsOperations()
154 containsCertificate(mDpm.getInstalledCaCerts(null), cert)).isTrue(); in testCaCertsOperations()
160 mDpm.uninstallCaCert(null, cert); in testCaCertsOperations()
[all …]
DCertSelectionDelegateTest.java41 import java.security.cert.Certificate;
42 import java.security.cert.CertificateException;
43 import java.security.cert.CertificateFactory;
103 final Certificate cert = getCertificate(FAKE_RSA_1.caCertificate); in testCanSelectKeychainKeypairs() local
105 assertThat(mDpm.installKeyPair(null, privKey, cert, alias)).isTrue(); in testCanSelectKeychainKeypairs()
152 private static Certificate getCertificate(byte[] cert) throws CertificateException { in getCertificate() argument
154 new ByteArrayInputStream(cert)); in getCertificate()
DCertInstallerReceiver.java27 import java.security.cert.CertificateException;
28 import java.security.cert.CertificateFactory;
32 import java.security.cert.Certificate;
121 String cert = intent.getStringExtra(EXTRA_CERT_DATA); in onReceive() local
130 new Base64InputStream(new ByteArrayInputStream(cert.getBytes()), in onReceive()
162 Certificate cert = readCertificate(certBuffer); in containsCertificate() local
163 if (certificateToMatch.equals(cert)) { in containsCertificate()
/cts/tests/tests/identity/src/android/security/identity/cts/
DAttestationTest.java34 import java.security.cert.Certificate;
35 import java.security.cert.X509Certificate;
91 X509Certificate cert = certChain.iterator().next(); in attestationTest() local
92 ParsedAttestationRecord record = new ParsedAttestationRecord(cert); in attestationTest()
145 X509Certificate cert = certs[i]; local
147 cert.checkValidity();
148 cert.verify(parent.getPublicKey());
153 parent = cert;
DX509CertificateSigningTest.java46 import java.security.cert.CertificateException;
47 import java.security.cert.X509Certificate;
87 X509Certificate cert = Util.signPublicKeyWithPrivateKey(keyToSignAlias, in testSigning() local
89 assertNotNull(cert); in testSigning()
90 Log.d(TAG, "Cert:\n--\n" + cert.toString() + "\n--\n"); in testSigning()
97 outputStream.write(cert.getEncoded()); in testSigning()
111 cert.getPublicKey().getEncoded()); in testSigning()
114 cert.verify(keyToSignWithKeyPair.getPublic()); // Throws if verification fails. in testSigning()
/cts/hostsidetests/devicepolicy/app/DeviceAndProfileOwner/scripts/
Dgenerate-client-cert-chain.sh33 -out certs/ca.cert.pem
59 -out intermediate/certs/intermediate.cert.pem
78 -out user.cert.pem
84 "$WORKDIR"/user.cert.pem \
85 "$WORKDIR"/intermediate/certs/intermediate.cert.pem \
86 "$WORKDIR"/rootca/certs/ca.cert.pem \
87 > "$TARGETDIR"/user-cert-chain.crt
95 -out "$TARGETDIR"/user-cert-chain.key
/cts/tests/tests/security/src/android/security/cts/
DCertificateTest.java29 import java.security.cert.Certificate;
30 import java.security.cert.CertificateEncodingException;
31 import java.security.cert.CertificateException;
32 import java.security.cert.CertificateFactory;
33 import java.security.cert.X509Certificate;
126 for (X509Certificate cert : loadCertsFromDisk(wfaCertsDir)) { in createWfaKeyStore()
127 keyStore.setCertificateEntry(String.format("%d", index++), cert); in createWfaKeyStore()
143 Certificate cert = certFactory.generateCertificate(fis); in loadCertsFromDisk() local
144 if (cert instanceof X509Certificate) { in loadCertsFromDisk()
145 certs.add((X509Certificate) cert); in loadCertsFromDisk()
DConscryptIntermediateVerificationTest.java24 import java.security.cert.Certificate;
25 import java.security.cert.CertificateException;
26 import java.security.cert.X509Certificate;
27 import java.security.cert.CertificateFactory;
54 for (Certificate cert : certs) { in loadCertificates()
55 result.add((X509Certificate) cert); in loadCertificates()
DCertBlacklistTest.java24 import java.security.cert.Certificate;
25 import java.security.cert.CertificateException;
26 import java.security.cert.CertificateFactory;
27 import java.security.cert.X509Certificate;
95 for (Certificate cert : collection) { in loadCertificates()
96 certs[i++] = (X509Certificate) cert; in loadCertificates()
/cts/hostsidetests/securitybulletin/securityPatch/CVE-2016-2109/
Dpoc.c29 X509 *cert; variable
37 cert = d2i_X509_bio(in, NULL); // x509 should be present on all Android systems in main()
39 if(cert != NULL){ in main()
40 X509_free(cert); in main()
/cts/tests/tests/networksecurityconfig/networksecurityconfig-resourcesrc/src/android/security/net/config/cts/
DResourceSourceTest.java24 import java.security.cert.Certificate;
25 import java.security.cert.CertificateFactory;
26 import java.security.cert.X509Certificate;
76 for (Certificate cert : factory.generateCertificates(is)) { in loadCertificates()
77 result.add((X509Certificate)cert); in loadCertificates()
94 for (X509Certificate cert : trustedCerts) { in getTrustedCertificates()
95 result.add(cert); in getTrustedCertificates()
/cts/tests/tests/net/src/android/net/http/cts/
DSslCertificateTest.java26 import java.security.cert.CertificateEncodingException;
27 import java.security.cert.CertificateException;
28 import java.security.cert.CertificateExpiredException;
29 import java.security.cert.CertificateNotYetValidException;
30 import java.security.cert.X509Certificate;
244 X509Certificate cert = new MockX509Certificate(); in testGetX509Certificate() local
245 ssl = new SslCertificate(cert); in testGetX509Certificate()
246 assertSame(cert, ssl.getX509Certificate()); in testGetX509Certificate()
DX509TrustManagerExtensionsTest.java22 import java.security.cert.Certificate;
23 import java.security.cert.X509Certificate;
51 for (Certificate cert : tm.getAcceptedIssuers()) { in testIsUserAddedCertificateDefaults()
52 assertFalse(xtm.isUserAddedCertificate((X509Certificate) cert)); in testIsUserAddedCertificateDefaults()
/cts/hostsidetests/devicepolicy/app/ProfileOwner/src/com/android/cts/profileowner/
DAdminActionBookkeepingTest.java27 import java.security.cert.Certificate;
28 import java.security.cert.CertificateFactory;
93 final Certificate cert = CertificateFactory.getInstance("X.509") in testGetPolicyInstalledCaCerts() local
99 assertNull(keyStore.getCertificateAlias(cert)); in testGetPolicyInstalledCaCerts()
101 final String alias = keyStore.getCertificateAlias(cert); in testGetPolicyInstalledCaCerts()
/cts/tests/security/src/android/keystore/cts/
DCertificateUtils.java21 import org.bouncycastle.cert.X509CertificateHolder;
22 import org.bouncycastle.cert.X509v3CertificateBuilder;
28 import java.security.cert.CertificateFactory;
29 import java.security.cert.X509Certificate;
/cts/tests/tests/net/src/org/apache/http/conn/ssl/cts/
DAbstractVerifierTest.java32 import java.security.cert.CertificateEncodingException;
33 import java.security.cert.CertificateException;
34 import java.security.cert.CertificateExpiredException;
35 import java.security.cert.CertificateNotYetValidException;
36 import java.security.cert.X509Certificate;
/cts/tests/tests/net/src/android/net/cts/
DIkev2VpnTest.java71 import java.security.cert.X509Certificate;
178 mServerRootCa = generateRandomCertAndKeyPair().cert; in Ikev2VpnTest()
243 mUserCertKey.cert, mUserCertKey.key, mServerRootCa); in buildIkev2VpnProfileDigitalSignature()
303 assertEquals(mUserCertKey.cert, profile.getUserCert()); in testBuildIkev2VpnProfileDigitalSignature()
502 public final X509Certificate cert; field in Ikev2VpnTest.CertificateAndKey
505 CertificateAndKey(X509Certificate cert, PrivateKey key) { in CertificateAndKey() argument
506 this.cert = cert; in CertificateAndKey()
532 final X509Certificate cert = certGen.generate(keyPair.getPrivate(), "AndroidOpenSSL"); in generateRandomCertAndKeyPair() local
533 return new CertificateAndKey(cert, keyPair.getPrivate()); in generateRandomCertAndKeyPair()
/cts/tests/tests/telephony/current/src/android/telephony/cts/
DImsiEncryptionInfoTest.java30 import java.security.cert.CertificateFactory;
76 private static PublicKey createPublicKey(String cert) throws Exception { in createPublicKey() argument
77 byte[] derCert = Base64.decode(cert.getBytes(), Base64.DEFAULT); in createPublicKey()
/cts/hostsidetests/devicepolicy/app/DeviceOwner/src/com/android/cts/deviceowner/
DAdminActionBookkeepingTest.java25 import java.security.cert.Certificate;
26 import java.security.cert.CertificateFactory;
222 final Certificate cert = CertificateFactory.getInstance("X.509") in testGetPolicyInstalledCaCerts() local
228 assertNull(keyStore.getCertificateAlias(cert)); in testGetPolicyInstalledCaCerts()
230 final String alias = keyStore.getCertificateAlias(cert); in testGetPolicyInstalledCaCerts()
/cts/tests/tests/networksecurityconfig/networksecurityconfig-cleartext/src/android/security/net/config/cts/
DCleartextPermittedTest.java19 import java.security.cert.CertificateException;
20 import java.security.cert.X509Certificate;

1234