本文整理汇总了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();
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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;
}
}
示例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();
}
示例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;
}
}