当前位置: 首页>>代码示例>>Java>>正文


Java OtrCryptoException.printStackTrace方法代码示例

本文整理汇总了Java中net.java.otr4j.crypto.OtrCryptoException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java OtrCryptoException.printStackTrace方法的具体用法?Java OtrCryptoException.printStackTrace怎么用?Java OtrCryptoException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.java.otr4j.crypto.OtrCryptoException的用法示例。


在下文中一共展示了OtrCryptoException.printStackTrace方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: savePublicKey

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
public void savePublicKey(SessionID sessionID, PublicKey pubKey) {
    if (sessionID == null)
        return;

    X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(pubKey.getEncoded());

    String fullUserId = sessionID.getFullUserID();
  //  if (!Address.hasResource(fullUserId))
    //    return;
    
    this.store.setProperty(fullUserId + ".publicKey", x509EncodedKeySpec.getEncoded());
    // Stash the associated fingerprint.  This saves calculating it in the future
    // and is useful for transferring rosters to other apps.
    try {
        String fingerprintString = new OtrCryptoEngineImpl().getFingerprint(pubKey);
        String verifiedToken = buildPublicKeyVerifiedId(fullUserId, fingerprintString.toLowerCase());
        if (!this.store.hasProperty(verifiedToken))
            this.store.setProperty(verifiedToken, false);
        
        this.store.setPropertyHex(fullUserId + ".fingerprint", Hex.decode(fingerprintString));
        store.save();
    } catch (OtrCryptoException e) {
        e.printStackTrace();
    }
}
 
开发者ID:prive,项目名称:prive-android,代码行数:26,代码来源:OtrAndroidKeyManagerImpl.java

示例2: getLocalFingerprint

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
/**
 * 
 * Returns the local finger print for specified session. If there is no
 * finger print you might generate one.
 * 
 * @return the local finger print for this sessionID
 */
public String getLocalFingerprint(SessionID sessionID) {
    KeyPair keyPair = loadLocalKeyPair(sessionID);

    if (keyPair == null)
        return null;

    PublicKey pubKey = keyPair.getPublic();

    try {
        return new OtrCryptoEngineImpl().getFingerprint(pubKey);
    } catch (OtrCryptoException e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:23,代码来源:MyOtrKeyManager.java

示例3: getLocalFingerprintRaw

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
public byte[] getLocalFingerprintRaw(SessionID sessionID) {
	try {
		return OtrCryptoEngine.getFingerprintRaw(getLocalKeyPair(sessionID)
						.getPublic());
	} catch (OtrCryptoException e) {
		e.printStackTrace();
	}
	return null;
}
 
开发者ID:zom,项目名称:zombot-java,代码行数:10,代码来源:OtrEngineHostImpl.java

示例4: getLocalFingerprintRaw

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
/**
 * @param sessionID
 * @return -- Given a SessionID, return the local fingerprint
 */

@Override
public byte[] getLocalFingerprintRaw(SessionID sessionID) {
    try {
        return new OtrCryptoEngineImpl()
                .getFingerprintRaw(getLocalKeyPair(sessionID)
                        .getPublic());
    } catch (OtrCryptoException e) {
        e.printStackTrace();
    }
    return null;
}
 
开发者ID:DanielKrawisz,项目名称:Shufflepuff,代码行数:17,代码来源:OtrChannel.java

示例5: getFingerprint

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
public String getFingerprint (PublicKey pubKey)
{
    try {
        String fingerprint = cryptoEngine.getFingerprint(pubKey);
        //  OtrDebugLogger.log("got fingerprint for: " + userId + "=" + fingerprint);
        return fingerprint;

    } catch (OtrCryptoException e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:13,代码来源:OtrAndroidKeyManagerImpl.java

示例6: getLocalFingerprint

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
public String getLocalFingerprint(SessionID sessionID) {
    KeyPair keyPair = loadLocalKeyPair(sessionID);

    if (keyPair == null)
        return null;

    PublicKey pubKey = keyPair.getPublic();

    try {
        return new OtrCryptoEngineImpl().getFingerprint(pubKey);
    } catch (OtrCryptoException e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:16,代码来源:OtrKeyManagerDefaultImpl.java

示例7: getRemoteFingerprint

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
public String getRemoteFingerprint(SessionID sessionID) {
    PublicKey remotePublicKey = loadRemotePublicKey(sessionID);
    if (remotePublicKey == null)
        return null;
    try {
        return new OtrCryptoEngineImpl().getFingerprint(remotePublicKey);
    } catch (OtrCryptoException e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:zom,项目名称:Zom-Android,代码行数:12,代码来源:OtrKeyManagerDefaultImpl.java

示例8: getLocalFingerprint

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
public String getLocalFingerprint(SessionID sessionID) {
	KeyPair keyPair = loadLocalKeyPair(sessionID);

	if (keyPair == null)
		return null;

	PublicKey pubKey = keyPair.getPublic();

	try {
		return new OtrCryptoEngineImpl().getFingerprint(pubKey);
	} catch (OtrCryptoException e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:BoogieMAN2K,项目名称:Beem,代码行数:16,代码来源:OtrKeyManagerImpl.java

示例9: getRemoteFingerprint

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
public String getRemoteFingerprint(SessionID sessionID) {
	PublicKey remotePublicKey = loadRemotePublicKey(sessionID);
	if (remotePublicKey == null)
		return null;
	try {
		return new OtrCryptoEngineImpl().getFingerprint(remotePublicKey);
	} catch (OtrCryptoException e) {
		e.printStackTrace();
		return null;
	}
}
 
开发者ID:BoogieMAN2K,项目名称:Beem,代码行数:12,代码来源:OtrKeyManagerImpl.java

示例10: getRemoteFingerprint

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
/**
 * Return remote finger print for specified sessionID.
 * 
 * @return finger print for remote contact
 */
public String getRemoteFingerprint(SessionID sessionID) {
    PublicKey remotePublicKey = loadRemotePublicKey(sessionID);
    if (remotePublicKey == null)
        return null;
    try {
        return new OtrCryptoEngineImpl().getFingerprint(remotePublicKey);
    } catch (OtrCryptoException e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:visit,项目名称:spark-svn-mirror,代码行数:17,代码来源:MyOtrKeyManager.java

示例11: storeLocalPublicKey

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
private void storeLocalPublicKey(String fullUserId, PublicKey pubKey) {
    
    String userId = Address.stripResource(fullUserId);

    X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(pubKey.getEncoded());

    this.store.setProperty(userId + ".publicKey", x509EncodedKeySpec.getEncoded());

    // Stash fingerprint for consistency.
    try {
        String fingerprintString = new OtrCryptoEngineImpl().getFingerprint(pubKey);
        this.store.setPropertyHex(userId + ".fingerprint", Hex.decode(fingerprintString));
    } catch (OtrCryptoException e) {
        e.printStackTrace();
    }
    

    store.save();
}
 
开发者ID:prive,项目名称:prive-android,代码行数:20,代码来源:OtrAndroidKeyManagerImpl.java

示例12: getLocalFingerprint

import net.java.otr4j.crypto.OtrCryptoException; //导入方法依赖的package包/类
public String getLocalFingerprint(String fullUserId) {
    
    String userId = Address.stripResource(fullUserId);

    KeyPair keyPair = loadLocalKeyPair(userId);

    if (keyPair == null)
        return null;

    PublicKey pubKey = keyPair.getPublic();

    try {
        String fingerprint = cryptoEngine.getFingerprint(pubKey);

        OtrDebugLogger.log("got fingerprint for: " + userId + "=" + fingerprint);

        return fingerprint;

    } catch (OtrCryptoException e) {
        e.printStackTrace();
        return null;
    }
}
 
开发者ID:prive,项目名称:prive-android,代码行数:24,代码来源:OtrAndroidKeyManagerImpl.java


注:本文中的net.java.otr4j.crypto.OtrCryptoException.printStackTrace方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。