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


Java OpenPgpSignatureResult.getKeyId方法代码示例

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


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

示例1: fetchKeyId

import org.openintents.openpgp.OpenPgpSignatureResult; //导入方法依赖的package包/类
public long fetchKeyId(Account account, String status, String signature) {
	if ((signature == null) || (api == null)) {
		return 0;
	}
	if (status == null) {
		status = "";
	}
	final StringBuilder pgpSig = new StringBuilder();
	pgpSig.append("-----BEGIN PGP SIGNED MESSAGE-----");
	pgpSig.append('\n');
	pgpSig.append('\n');
	pgpSig.append(status);
	pgpSig.append('\n');
	pgpSig.append("-----BEGIN PGP SIGNATURE-----");
	pgpSig.append('\n');
	pgpSig.append('\n');
	pgpSig.append(signature.replace("\n", "").trim());
	pgpSig.append('\n');
	pgpSig.append("-----END PGP SIGNATURE-----");
	Intent params = new Intent();
	params.setAction(OpenPgpApi.ACTION_DECRYPT_VERIFY);
	params.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);
	InputStream is = new ByteArrayInputStream(pgpSig.toString().getBytes());
	ByteArrayOutputStream os = new ByteArrayOutputStream();
	Intent result = api.executeApi(params, is, os);
	switch (result.getIntExtra(OpenPgpApi.RESULT_CODE,
			OpenPgpApi.RESULT_CODE_ERROR)) {
	case OpenPgpApi.RESULT_CODE_SUCCESS:
		OpenPgpSignatureResult sigResult = result
				.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);
		if (sigResult != null) {
			return sigResult.getKeyId();
		} else {
			return 0;
		}
	case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:
		return 0;
	case OpenPgpApi.RESULT_CODE_ERROR:
		logError(account, (OpenPgpError) result.getParcelableExtra(OpenPgpApi.RESULT_ERROR));
		return 0;
	}
	return 0;
}
 
开发者ID:syntafin,项目名称:TenguChat,代码行数:44,代码来源:PgpEngine.java

示例2: fetchKeyId

import org.openintents.openpgp.OpenPgpSignatureResult; //导入方法依赖的package包/类
public long fetchKeyId(Account account, String status, String signature) {
	if ((signature == null) || (api == null)) {
		return 0;
	}
	if (status == null) {
		status = "";
	}
	final StringBuilder pgpSig = new StringBuilder();
	pgpSig.append("-----BEGIN PGP SIGNED MESSAGE-----");
	pgpSig.append('\n');
	pgpSig.append('\n');
	pgpSig.append(status);
	pgpSig.append('\n');
	pgpSig.append("-----BEGIN PGP SIGNATURE-----");
	pgpSig.append('\n');
	pgpSig.append('\n');
	pgpSig.append(signature.replace("\n", "").trim());
	pgpSig.append('\n');
	pgpSig.append("-----END PGP SIGNATURE-----");
	Intent params = new Intent();
	params.setAction(OpenPgpApi.ACTION_DECRYPT_VERIFY);
	params.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);
	InputStream is = new ByteArrayInputStream(pgpSig.toString().getBytes());
	ByteArrayOutputStream os = new ByteArrayOutputStream();
	Intent result = api.executeApi(params, is, os);
	notifyPgpDecryptionService(account, OpenPgpApi.ACTION_DECRYPT_VERIFY, result);
	switch (result.getIntExtra(OpenPgpApi.RESULT_CODE,
			OpenPgpApi.RESULT_CODE_ERROR)) {
	case OpenPgpApi.RESULT_CODE_SUCCESS:
		OpenPgpSignatureResult sigResult = result
				.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);
		if (sigResult != null) {
			return sigResult.getKeyId();
		} else {
			return 0;
		}
	case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:
		return 0;
	case OpenPgpApi.RESULT_CODE_ERROR:
		return 0;
	}
	return 0;
}
 
开发者ID:xavierle,项目名称:messengerxmpp,代码行数:44,代码来源:PgpEngine.java

示例3: fetchKeyId

import org.openintents.openpgp.OpenPgpSignatureResult; //导入方法依赖的package包/类
public long fetchKeyId(Account account, String status, String signature) {
    if ((signature == null) || (api == null)) {
        return 0;
    }
    if (status == null) {
        status = "";
    }
    final StringBuilder pgpSig = new StringBuilder();
    pgpSig.append("-----BEGIN PGP SIGNED MESSAGE-----");
    pgpSig.append('\n');
    pgpSig.append('\n');
    pgpSig.append(status);
    pgpSig.append('\n');
    pgpSig.append("-----BEGIN PGP SIGNATURE-----");
    pgpSig.append('\n');
    pgpSig.append('\n');
    pgpSig.append(signature.replace("\n", "").trim());
    pgpSig.append('\n');
    pgpSig.append("-----END PGP SIGNATURE-----");
    Intent params = new Intent();
    params.setAction(OpenPgpApi.ACTION_DECRYPT_VERIFY);
    params.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);
    InputStream is = new ByteArrayInputStream(pgpSig.toString().getBytes());
    ByteArrayOutputStream os = new ByteArrayOutputStream();
    Intent result = api.executeApi(params, is, os);
    switch (result.getIntExtra(OpenPgpApi.RESULT_CODE,
            OpenPgpApi.RESULT_CODE_ERROR)) {
        case OpenPgpApi.RESULT_CODE_SUCCESS:
            OpenPgpSignatureResult sigResult = result
                    .getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);
            if (sigResult != null) {
                return sigResult.getKeyId();
            } else {
                return 0;
            }
        case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:
            return 0;
        case OpenPgpApi.RESULT_CODE_ERROR:
            logError(account, (OpenPgpError) result.getParcelableExtra(OpenPgpApi.RESULT_ERROR));
            return 0;
    }
    return 0;
}
 
开发者ID:kriztan,项目名称:Pix-Art-Messenger,代码行数:44,代码来源:PgpEngine.java

示例4: fetchKeyId

import org.openintents.openpgp.OpenPgpSignatureResult; //导入方法依赖的package包/类
public long fetchKeyId(Account account, String status, String signature) {
	if ((signature == null) || (api == null)) {
		return 0;
	}
	if (status == null) {
		status = "";
	}
	final StringBuilder pgpSig = new StringBuilder();
	pgpSig.append("-----BEGIN PGP SIGNED MESSAGE-----");
	pgpSig.append('\n');
	pgpSig.append('\n');
	pgpSig.append(status);
	pgpSig.append('\n');
	pgpSig.append("-----BEGIN PGP SIGNATURE-----");
	pgpSig.append('\n');
	pgpSig.append('\n');
	pgpSig.append(signature.replace("\n", "").trim());
	pgpSig.append('\n');
	pgpSig.append("-----END PGP SIGNATURE-----");
	Intent params = new Intent();
	params.setAction(OpenPgpApi.ACTION_DECRYPT_VERIFY);
	params.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);
	params.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, account.getJid().toBareJid().toString());
	InputStream is = new ByteArrayInputStream(pgpSig.toString().getBytes());
	ByteArrayOutputStream os = new ByteArrayOutputStream();
	Intent result = api.executeApi(params, is, os);
	switch (result.getIntExtra(OpenPgpApi.RESULT_CODE,
			OpenPgpApi.RESULT_CODE_ERROR)) {
	case OpenPgpApi.RESULT_CODE_SUCCESS:
		OpenPgpSignatureResult sigResult = result
				.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);
		if (sigResult != null) {
			return sigResult.getKeyId();
		} else {
			return 0;
		}
	case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:
		return 0;
	case OpenPgpApi.RESULT_CODE_ERROR:
		return 0;
	}
	return 0;
}
 
开发者ID:juanignaciomolina,项目名称:txtr,代码行数:44,代码来源:PgpEngine.java

示例5: fetchKeyId

import org.openintents.openpgp.OpenPgpSignatureResult; //导入方法依赖的package包/类
public long fetchKeyId(Account account, String status, String signature) {
	if ((signature == null) || (api == null)) {
		return 0;
	}
	if (status == null) {
		status = "";
	}
	StringBuilder pgpSig = new StringBuilder();
	pgpSig.append("-----BEGIN PGP SIGNED MESSAGE-----");
	pgpSig.append('\n');
	pgpSig.append('\n');
	pgpSig.append(status);
	pgpSig.append('\n');
	pgpSig.append("-----BEGIN PGP SIGNATURE-----");
	pgpSig.append('\n');
	pgpSig.append('\n');
	pgpSig.append(signature.replace("\n", "").trim());
	pgpSig.append('\n');
	pgpSig.append("-----END PGP SIGNATURE-----");
	Intent params = new Intent();
	params.setAction(OpenPgpApi.ACTION_DECRYPT_VERIFY);
	params.putExtra(OpenPgpApi.EXTRA_REQUEST_ASCII_ARMOR, true);
	params.putExtra(OpenPgpApi.EXTRA_ACCOUNT_NAME, account.getJid());
	InputStream is = new ByteArrayInputStream(pgpSig.toString().getBytes());
	ByteArrayOutputStream os = new ByteArrayOutputStream();
	Intent result = api.executeApi(params, is, os);
	switch (result.getIntExtra(OpenPgpApi.RESULT_CODE,
			OpenPgpApi.RESULT_CODE_ERROR)) {
	case OpenPgpApi.RESULT_CODE_SUCCESS:
		OpenPgpSignatureResult sigResult = result
				.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);
		if (sigResult != null) {
			return sigResult.getKeyId();
		} else {
			return 0;
		}
	case OpenPgpApi.RESULT_CODE_USER_INTERACTION_REQUIRED:
		return 0;
	case OpenPgpApi.RESULT_CODE_ERROR:
		Log.d("xmppService",
				"openpgp error: "
						+ ((OpenPgpError) result
								.getParcelableExtra(OpenPgpApi.RESULT_ERROR))
								.getMessage());
		return 0;
	}
	return 0;
}
 
开发者ID:GitESS,项目名称:SyncChatAndroid,代码行数:49,代码来源:PgpEngine.java


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