Code example for Certificate

Methods: hashCode

0
     * @param peerCert 
     */ 
    synchronized void storeCertificate(final Certificate peerCert) {
        try { 
            String alias = String.format(KeyStoreManager.REMOTE_IDENTITY_ALIAS_PATTERN,
                    peerCert.hashCode());
            if (mKeyStore.containsAlias(alias)) {
                Log.w(LOG_TAG, "Deleting existing entry for " + alias);
                mKeyStore.deleteEntry(alias);
            } 
            Log.i(LOG_TAG, "Adding cert to keystore: " + alias);
            mKeyStore.setCertificateEntry(alias, peerCert);
            store(); 
 
            try { 
                collectTrustManagers(); 
            } catch (GeneralSecurityException e) {
                // ignore. 
            } 
        } catch (KeyStoreException e) {
            Log.e(LOG_TAG, "Storing cert failed", e);