Best code examples for Java 8 KeyStore class (java.security.KeyStore)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 KeyStore class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 KeyStore examples from Open Source projects
This code example shows how to use the following methods: load, setCertificateEntry, store
217:	mKnownServersStore.load(null, LOCAL_TRUSTSTORE_PASSWORD.toCharArray()); // necessary to initialize an empty KeyStore instance 
-
227:	knownServers.setCertificateEntry(Integer.toString(cert.hashCode()), cert); 
-
231:	knownServers.store(fos, LOCAL_TRUSTSTORE_PASSWORD.toCharArray()); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: load, setCertificateEntry, setKeyEntry, store
340:	_ks.load(null, _keystorepass); 
-
342:	_ks.setCertificateEntry(_caCertAlias, signingCert); 
343:	_ks.setKeyEntry(_caPrivKeyAlias, caPrivKey, _keypassword, new Certificate[] {signingCert}); 
-
348:	_ks.store(os, _keystorepass); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: getCertificate, getCertificateAlias, getCertificateChain, setCertificateEntry
132:	validate(keyStore, keyStore.getCertificate(keyAlias)); 
-
169:	certAlias = keyStore.getCertificateAlias((X509Certificate)cert); 
-
173:	keyStore.setCertificateEntry(certAlias, cert); 
-
176:	certChain = keyStore.getCertificateChain(certAlias); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: containsAlias, getKey, load, store
339:	ks.load(new ByteArrayInputStream(data), oldStorePass); 
-
341:	if (!ks.containsAlias("android")) 
-
346:	Key key = ks.getKey("android", oldStorePass); 
-
354:	ks.store(bOut, oldStorePass); 
Full Snippet Info
7
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, setCertificateEntry, store
181:	mKeyStore.store(fos, KEYSTORE_PASSWORD); 
-
245:	if (mKeyStore.containsAlias(alias)) { 
-
247:	mKeyStore.deleteEntry(alias); 
-
250:	mKeyStore.setCertificateEntry(alias, peerCert); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCertificateChain, getKey, load
56:	keyStore.load(null, password); 
-
64:	keyStore.load(input, password); 
65:	caPrivateKey = (PrivateKey) keyStore.getKey(STORE_KEY, password); 
66:	final Certificate[] chain = keyStore.getCertificateChain(STORE_KEY); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: store
132:	ks.store(out, password.toCharArray()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCertificateChain, getKey, load
92:	keystore.load(is, password); 
93:	caKey = (PrivateKey) keystore.getKey(CA, password); 
-
98:	caCerts = cast(keystore.getCertificateChain(CA)); 
-
102:	keystore.load(null, password); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: aliases, getType, load, size
57:	secureStorage.load(null); 
-
59:	Log.i(TAG, "Key store initialized. Type: " + secureStorage.getType() + ""); 
60:	Log.d(TAG, "Key store size: " + secureStorage.size()); 
61:	Log.d(TAG, "Key store alises: " + secureStorage.aliases()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCertificate, setCertificateEntry
24:	Certificate c = ks.getCertificate(alias); 
-
38:	ks.setCertificateEntry(alias, cert); 
39:	store(ks, keystore); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: aliases, getCertificate, getKey, load
62:	keyStore.load(new FileInputStream(keystorePath), password); 
-
151:	Enumeration<String> aliases = keyStore.aliases(); 
-
154:	Certificate certificate = keyStore.getCertificate(alias); 
155:	Key key = keyStore.getKey(alias, password); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: containsAlias, entryInstanceOf, getCertificate, isCertificateEntry
56:	assertEquals("Certs do not match in client keystore file", securityService.getCertificate(moduleKeyStoreAlias), clientKeyStore.getCertificate(moduleKeyStoreAlias)); 
-
60:	assertEquals("Certs do not match in module keystore file", clientKeyStore.getCertificate(moduleKeyStoreAlias), securityService.getCertificate(moduleKeyStoreAlias)); 
-
64:	assertTrue("Alias for Certificate Entry '" + certificateEntryAlias + "' should exist in " + keyStoreQualifier + " keystore file", keyStore.containsAlias(certificateEntryAlias)); 
65:	assertTrue("Alias '" + certificateEntryAlias + "' should be Certificate Entry in " + keyStoreQualifier + " keystore file", keyStore.isCertificateEntry(certificateEntryAlias)); 
66:	assertTrue("Alias for Private Key Entry '" + privateKeyEntryAlias + "' should exist in " + keyStoreQualifier + " keystore file", keyStore.containsAlias(privateKeyEntryAlias)); 
67:	assertTrue("Alias '" + privateKeyEntryAlias + "' should be Private Key Entry in " + keyStoreQualifier + " keystore file", keyStore.entryInstanceOf(privateKeyEntryAlias, KeyStore.PrivateKeyEntry.class)); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: aliases
58:	this.credentialResolver = new KeyStoreCredentialResolver(keyStore, passwords); 
-
93:	Enumeration<String> aliases = keyStore.aliases(); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, setCertificateEntry, store
181:	mKeyStore.store(fos, KEYSTORE_PASSWORD); 
-
245:	if (mKeyStore.containsAlias(alias)) { 
-
247:	mKeyStore.deleteEntry(alias); 
-
250:	mKeyStore.setCertificateEntry(alias, peerCert); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCertificate, getCertificateAlias, getCertificateChain, setCertificateEntry
132:	validate(keyStore, keyStore.getCertificate(keyAlias)); 
-
169:	certAlias = keyStore.getCertificateAlias((X509Certificate)cert); 
-
173:	keyStore.setCertificateEntry(certAlias, cert); 
-
176:	certChain = keyStore.getCertificateChain(certAlias); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, setCertificateEntry, store
162:	keyStore.store(fos, KEYSTORE_PASSWORD); 
-
218:	if (mKeyStore.containsAlias(alias)) { 
-
220:	mKeyStore.deleteEntry(alias); 
-
223:	mKeyStore.setCertificateEntry(alias, peerCert); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCertificate, getCertificateAlias, getCertificateChain, setCertificateEntry
130:	validate(keyStore, keyStore.getCertificate(keyAlias)); 
-
167:	certAlias = keyStore.getCertificateAlias((X509Certificate)cert); 
-
171:	keyStore.setCertificateEntry(certAlias, cert); 
-
174:	certChain = keyStore.getCertificateChain(certAlias); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry
216:	if (keyStore.containsAlias(name)) { 
217:	keyStore.deleteEntry(name); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCertificate, getKey
40:	X509Certificate certificate = (X509Certificate) ks.getCertificate(alias); 
41:	PrivateKey privateKey = (PrivateKey) ks.getKey(alias, senhaDoCertificado.toCharArray()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: load
21:	ks.load(keyStore, storePass.toCharArray()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getKey, setKeyEntry, store
103:	PrivateKey key = (PrivateKey) pregeneratedKeys.getKey(alias, PASSPHRASE); 
-
107:	pregeneratedKeys.setKeyEntry(alias, result.getPrivate(), PASSPHRASE, new Certificate[]{createCertificate(result).getCertificate()}); 
-
110:	pregeneratedKeys.store(output, PASSPHRASE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, setCertificateEntry, store
162:	keyStore.store(fos, KEYSTORE_PASSWORD); 
-
218:	if (mKeyStore.containsAlias(alias)) { 
-
220:	mKeyStore.deleteEntry(alias); 
-
223:	mKeyStore.setCertificateEntry(alias, peerCert); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: load
81:	ks.load(in, passPhrase); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: deleteEntry, getCertificateAlias, setCertificateEntry, setKeyEntry, store
251:	String alias = ks.getCertificateAlias(cert); 
-
254:	ks.deleteEntry(alias); 
-
257:	ks.store(outStream, keyStorePassword == null ? null : keyStorePassword.toCharArray()); 
-
295:	ks.setKeyEntry(alias, ((X509CertificateEx)cert).getPrivateKey(), 
-
298:	ks.setCertificateEntry(alias, cert); 
-
302:	ks.store(outStream, keyStorePassword == null ? null : keyStorePassword.toCharArray()); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: containsAlias, getKey, load, store
339:	ks.load(new ByteArrayInputStream(data), oldStorePass); 
-
341:	if (!ks.containsAlias("android")) 
-
346:	Key key = ks.getKey("android", oldStorePass); 
-
354:	ks.store(bOut, oldStorePass); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: deleteEntry, getCertificateChain, getKey, setKeyEntry
193:	Key var5 = var3.getKey(var2, var4); 
194:	Certificate[] var6 = this.mKeyStore.getCertificateChain(var2); 
-
197:	var7.setKeyEntry(var1, var5, var8, var6); 
198:	this.mKeyStore.deleteEntry(var2); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, setCertificateEntry, store
162:	keyStore.store(fos, KEYSTORE_PASSWORD); 
-
218:	if (mKeyStore.containsAlias(alias)) { 
-
220:	mKeyStore.deleteEntry(alias); 
-
223:	mKeyStore.setCertificateEntry(alias, peerCert); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: load
126:	store.load(is, password); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: getCertificate, getKey
146:	Key key = ks.getKey(alias, password); 
-
149:	Certificate cert = ks.getCertificate(alias); 
-
156:	Certificate cert = ks.getCertificate(alias); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, store
122:	if (keyStore.containsAlias(KEYSTORE_KEY_ALIAS)) { 
123:	keyStore.deleteEntry(KEYSTORE_KEY_ALIAS); 
124:	keyStore.store(new NullOutputStream(), KEYSTORE_PASSPHRASE); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, setCertificateEntry, store
181:	mKeyStore.store(fos, KEYSTORE_PASSWORD); 
-
245:	if (mKeyStore.containsAlias(alias)) { 
-
247:	mKeyStore.deleteEntry(alias); 
-
250:	mKeyStore.setCertificateEntry(alias, peerCert); 
Full Snippet Info
6
CodeRank
This code example shows how to use the following methods: store
135:	ks.store(out, password.toCharArray()); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, setCertificateEntry
243:	if (mKeyStore.containsAlias(alias)) { 
-
245:	mKeyStore.deleteEntry(alias); 
-
248:	mKeyStore.setCertificateEntry(alias, peerCert); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: load
67:	ks.load(is, keyStorePassword); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: load, setCertificateEntry
139:	mockKeyStore.load(null, null); 
-
141:	mockKeyStore.setCertificateEntry(null, null); 
-
143:	mockKeyStore.setCertificateEntry(null, certificate); 
-
145:	mockKeyStore.setCertificateEntry("Alias", null); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, setCertificateEntry, store
162:	keyStore.store(fos, KEYSTORE_PASSWORD); 
-
218:	if (mKeyStore.containsAlias(alias)) { 
-
220:	mKeyStore.deleteEntry(alias); 
-
223:	mKeyStore.setCertificateEntry(alias, peerCert); 
Full Snippet Info
5
CodeRank
This code example shows how to use the following methods: containsAlias, deleteEntry, setCertificateEntry, store
183:	mKeyStore.store(fos, KEYSTORE_PASSWORD); 
-
254:	if (mKeyStore.containsAlias(alias)) { 
-
256:	mKeyStore.deleteEntry(alias); 
-
259:	mKeyStore.setCertificateEntry(alias, peerCert); 
Full Snippet Info
5
CodeRank
Related Java 8 KeyStore Questions & Answers:
See Code Examples for Java 8 KeyStore Methods: