private void addCACertificateToTrustStore(Certificate certificate) throws InvalidArgumentException, CryptoException { String alias; if (certificate instanceof X509Certificate) { alias = ((X509Certificate) certificate).getSerialNumber().toString(); } else { // not likely ... alias = Integer.toString(certificate.hashCode()); } addCACertificateToTrustStore(certificate, alias); }
/** * {@inheritDoc} */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_certificate == null) ? 0 : _certificate.hashCode()); return result; }
/** * {@inheritDoc} */ @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((_certificate == null) ? 0 : _certificate.hashCode()); return result; }
public int hashCode() { int result = mdAlgorithm.hashCode(); for (int i = 0; i < chain.length; i++) result += chain[i].hashCode(); // Note that we do not hash based on trustAnchor; // this changes dynamically but we need a constant hashCode for purposes of // hashing in a Set. return result; }
public int hashCode() { int result = mdAlgorithm.hashCode(); for (int i = 0; i < chain.length; i++) result += chain[i].hashCode(); // Note that we do not hash based on trustAnchor; // this changes dynamically but we need a constant hashCode for purposes of // hashing in a Set. return result; }
public int hashCode() { int result = mdAlgorithm.hashCode(); for (int i = 0; i < chain.length; i++) result += chain[i].hashCode(); // Note that we do not hash based on trustAnchor; // this changes dynamically but we need a constant hashCode for purposes of // hashing in a Set. return result; }
public int hashCode() { int result = mdAlgorithm.hashCode(); for (int i = 0; i < chain.length; i++) result += chain[i].hashCode(); // Note that we do not hash based on trustAnchor; // this changes dynamically but we need a constant hashCode for purposes of // hashing in a Set. return result; }
public int hashCode() { int result = mdAlgorithm.hashCode(); for (int i = 0; i < chain.length; i++) result += chain[i].hashCode(); // Note that we do not hash based on trustAnchor; // this changes dynamically but we need a constant hashCode for purposes of // hashing in a Set. return result; }
public int hashCode() { int result = mdAlgorithm.hashCode(); for (int i = 0; i < chain.length; i++) result += chain[i].hashCode(); // Note that we do not hash based on trustAnchor; // this changes dynamically but we need a constant hashCode for purposes of // hashing in a Set. return result; }
public int hashCode() { int result = mdAlgorithm.hashCode(); for (int i = 0; i < chain.length; i++) result += chain[i].hashCode(); // Note that we do not hash based on trustAnchor; // this changes dynamically but we need a constant hashCode for purposes of // hashing in a Set. return result; }
public int hashCode() { int result = mdAlgorithm.hashCode(); for (int i = 0; i < chain.length; i++) result += chain[i].hashCode(); // Note that we do not hash based on trustAnchor; // this changes dynamically but we need a constant hashCode for purposes of // hashing in a Set. return result; }
private void addCACertificateToTrustStore(Certificate certificate) throws InvalidArgumentException, CryptoException { String alias; if (certificate instanceof X509Certificate) { alias = ((X509Certificate) certificate).getSerialNumber().toString(); } else { // not likely ... alias = Integer.toString(certificate.hashCode()); } addCACertificateToTrustStore(certificate, alias); }
private void addCACertificateToTrustStore(Certificate certificate) throws InvalidArgumentException, CryptoException { String alias; if (certificate instanceof X509Certificate) { alias = ((X509Certificate) certificate).getSerialNumber().toString(); } else { // not likely ... alias = Integer.toString(certificate.hashCode()); } addCACertificateToTrustStore(certificate, alias); }
public static boolean isCertInKnownServersStore(Certificate cert, Context context) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { KeyStore knownServers = getKnownServersStore(context); Log_OC.d(TAG, "Certificate - HashCode: " + cert.hashCode() + " " + Boolean.toString(knownServers.isCertificateEntry(Integer.toString(cert.hashCode())))); return knownServers.isCertificateEntry(Integer.toString(cert.hashCode())); }
public static void addCertToKnownServersStore(Certificate cert, Context context) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { KeyStore knownServers = getKnownServersStore(context); knownServers.setCertificateEntry(Integer.toString(cert.hashCode()), cert); FileOutputStream fos = null; try { fos = context.openFileOutput(LOCAL_TRUSTSTORE_FILENAME, Context.MODE_PRIVATE); knownServers.store(fos, LOCAL_TRUSTSTORE_PASSWORD.toCharArray()); } finally { fos.close(); } }
public static boolean isCertInKnownServersStore(Certificate cert, Context context) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { KeyStore knownServers = getKnownServersStore(context); Log_OC.d(TAG, "Certificate - HashCode: " + cert.hashCode() + " " + Boolean.toString(knownServers.isCertificateEntry(Integer.toString(cert.hashCode())))); return knownServers.isCertificateEntry(Integer.toString(cert.hashCode())); }
public static void addCertToKnownServersStore(Certificate cert, Context context) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException { KeyStore knownServers = getKnownServersStore(context); knownServers.setCertificateEntry(Integer.toString(cert.hashCode()), cert); FileOutputStream fos = null; try { fos = context.openFileOutput(LOCAL_TRUSTSTORE_FILENAME, Context.MODE_PRIVATE); knownServers.store(fos, LOCAL_TRUSTSTORE_PASSWORD.toCharArray()); } finally { fos.close(); } }
for(Certificate cert : certs){ System.out.println("Cert Type : " + cert.getType()); System.out.println("Cert Hash Code : " + cert.hashCode()); System.out.println("Cert Public Key Algorithm : " + cert.getPublicKey().getAlgorithm());
System.err.println("* Hash Code : " + cert.hashCode()); System.err.println("* PubKey Algo : " + cert.getPublicKey().getAlgorithm()); System.err.println("* PubKey Format : " + cert.getPublicKey().getFormat());
for(Certificate cert : certs){ System.out.println("Cert Type : " + cert.getType()); System.out.println("Cert Hash Code : " + cert.hashCode()); System.out.println("Cert Public Key Algorithm : " + cert.getPublicKey().getAlgorithm()); System.out.println("Cert Public Key Format : " + cert.getPublicKey().getFormat());