本文整理汇总了Java中org.openintents.openpgp.OpenPgpSignatureResult类的典型用法代码示例。如果您正苦于以下问题:Java OpenPgpSignatureResult类的具体用法?Java OpenPgpSignatureResult怎么用?Java OpenPgpSignatureResult使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OpenPgpSignatureResult类属于org.openintents.openpgp包,在下文中一共展示了OpenPgpSignatureResult类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: CryptoResultAnnotation
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
private CryptoResultAnnotation(@NonNull CryptoError errorType, MimeBodyPart replacementData,
OpenPgpDecryptionResult openPgpDecryptionResult,
OpenPgpSignatureResult openPgpSignatureResult,
PendingIntent openPgpPendingIntent,
PendingIntent openPgpInsecureWarningPendingIntent,
OpenPgpError openPgpError,
boolean overrideCryptoWarning) {
this.errorType = errorType;
this.replacementData = replacementData;
this.openPgpDecryptionResult = openPgpDecryptionResult;
this.openPgpSignatureResult = openPgpSignatureResult;
this.openPgpPendingIntent = openPgpPendingIntent;
this.openPgpError = openPgpError;
this.openPgpInsecureWarningPendingIntent = openPgpInsecureWarningPendingIntent;
this.sMimeDecryptionResult = null;
this.sMimeSignatureResult = null;
this.sMimePendingIntent = null;
this.sMimeError = null;
this.sMimeInsecureWarningPendingIntent = null;
this.overrideCryptoWarning = overrideCryptoWarning;
this.encapsulatedResult = null;
}
示例2: assertPartAnnotationHasState
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
private void assertPartAnnotationHasState(Message message, MessageCryptoCallback messageCryptoCallback,
CryptoError cryptoErrorState, MimeBodyPart replacementPart, OpenPgpDecryptionResult openPgpDecryptionResult,
OpenPgpSignatureResult openPgpSignatureResult, PendingIntent openPgpPendingIntent,
SMimeDecryptionResult sMimeDecryptionResult,
SMimeSignatureResult sMimeSignatureResult, PendingIntent sMimePendingIntent) {
ArgumentCaptor<MessageCryptoAnnotations> captor = ArgumentCaptor.forClass(MessageCryptoAnnotations.class);
verify(messageCryptoCallback).onCryptoOperationsFinished(captor.capture());
MessageCryptoAnnotations annotations = captor.getValue();
CryptoResultAnnotation cryptoResultAnnotation = annotations.get(message);
assertEquals(cryptoErrorState, cryptoResultAnnotation.getErrorType());
if (replacementPart != null) {
assertSame(replacementPart, cryptoResultAnnotation.getReplacementData());
}
assertSame(openPgpDecryptionResult, cryptoResultAnnotation.getOpenPgpDecryptionResult());
assertSame(openPgpSignatureResult, cryptoResultAnnotation.getOpenPgpSignatureResult());
assertSame(openPgpPendingIntent, cryptoResultAnnotation.getOpenPgpPendingIntent());
assertSame(sMimeDecryptionResult, cryptoResultAnnotation.getSMimeDecryptionResult());
assertSame(sMimeSignatureResult, cryptoResultAnnotation.getSMimeSignatureResult());
assertSame(sMimePendingIntent, cryptoResultAnnotation.getSMimePendingIntent());
verifyNoMoreInteractions(messageCryptoCallback);
}
示例3: signatureResultToUiText
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
public static String signatureResultToUiText(Context ctx, OpenPgpSignatureResult sr) {
switch (sr.getResult()) {
case OpenPgpSignatureResult.RESULT_INVALID_INSECURE:
return ctx.getString(R.string.signature_result__invalid_insecure);
case OpenPgpSignatureResult.RESULT_INVALID_KEY_EXPIRED:
return ctx.getString(R.string.signature_result__invalid_key_expired);
case OpenPgpSignatureResult.RESULT_INVALID_KEY_REVOKED:
return ctx.getString(R.string.signature_result__invalid_key_revoked);
case OpenPgpSignatureResult.RESULT_INVALID_SIGNATURE:
return ctx.getString(R.string.signature_result__invalid);
case OpenPgpSignatureResult.RESULT_KEY_MISSING:
return ctx.getString(R.string.signature_result__key_missing);
case OpenPgpSignatureResult.RESULT_NO_SIGNATURE:
return ctx.getString(R.string.signature_result__no_signature);
case OpenPgpSignatureResult.RESULT_VALID_CONFIRMED:
return ctx.getString(R.string.signature_result__valid_confirmed);
case OpenPgpSignatureResult.RESULT_VALID_UNCONFIRMED:
return ctx.getString(R.string.signature_result__valid_unconfirmed);
default:
return null;
}
}
示例4: signatureResultToUiColorResId
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
public static int signatureResultToUiColorResId(OpenPgpSignatureResult sr) {
switch (sr.getResult()) {
case OpenPgpSignatureResult.RESULT_INVALID_INSECURE:
case OpenPgpSignatureResult.RESULT_INVALID_KEY_EXPIRED:
case OpenPgpSignatureResult.RESULT_INVALID_KEY_REVOKED:
return R.color.colorWarning;
case OpenPgpSignatureResult.RESULT_INVALID_SIGNATURE:
case OpenPgpSignatureResult.RESULT_KEY_MISSING:
case OpenPgpSignatureResult.RESULT_NO_SIGNATURE:
return R.color.colorError;
case OpenPgpSignatureResult.RESULT_VALID_UNCONFIRMED:
case OpenPgpSignatureResult.RESULT_VALID_CONFIRMED:
return R.color.colorOk;
default:
return 0;
}
}
示例5: signatureResultToUiIconRes
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
public static int signatureResultToUiIconRes(OpenPgpSignatureResult sr, boolean small) {
switch (sr.getResult()) {
case OpenPgpSignatureResult.RESULT_INVALID_INSECURE:
case OpenPgpSignatureResult.RESULT_INVALID_KEY_EXPIRED:
case OpenPgpSignatureResult.RESULT_INVALID_KEY_REVOKED:
case OpenPgpSignatureResult.RESULT_INVALID_SIGNATURE:
return small ? R.drawable.ic_error_red_18dp : R.drawable.ic_error_red_24dp;
case OpenPgpSignatureResult.RESULT_NO_SIGNATURE:
return small ? R.drawable.ic_warning_red_18dp : R.drawable.ic_warning_red_24dp;
case OpenPgpSignatureResult.RESULT_KEY_MISSING:
return small ? R.drawable.ic_warning_orange_18dp : R.drawable.ic_warning_orange_24dp;
case OpenPgpSignatureResult.RESULT_VALID_UNCONFIRMED:
return small ? R.drawable.ic_done_orange_18dp : R.drawable.ic_done_orange_24dp;
case OpenPgpSignatureResult.RESULT_VALID_CONFIRMED:
return small ? R.drawable.ic_done_all_green_a700_18dp : R.drawable.ic_done_all_green_a700_24dp;
default:
return 0;
}
}
示例6: signatureResultToUiColorResId_KeyOnly
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
public static int signatureResultToUiColorResId_KeyOnly(OpenPgpSignatureResult sr) {
switch (sr.getResult()) {
case OpenPgpSignatureResult.RESULT_INVALID_INSECURE:
case OpenPgpSignatureResult.RESULT_INVALID_KEY_EXPIRED:
case OpenPgpSignatureResult.RESULT_INVALID_KEY_REVOKED:
case OpenPgpSignatureResult.RESULT_INVALID_SIGNATURE:
case OpenPgpSignatureResult.RESULT_KEY_MISSING:
case OpenPgpSignatureResult.RESULT_NO_SIGNATURE:
case OpenPgpSignatureResult.RESULT_VALID_UNCONFIRMED:
return R.color.colorWarning;
case OpenPgpSignatureResult.RESULT_VALID_CONFIRMED:
return R.color.colorOk;
default:
return 0;
}
}
示例7: signatureResultToUiIconRes_KeyOnly
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
public static int signatureResultToUiIconRes_KeyOnly(OpenPgpSignatureResult sr, boolean small) {
switch (sr.getResult()) {
case OpenPgpSignatureResult.RESULT_INVALID_INSECURE:
case OpenPgpSignatureResult.RESULT_INVALID_KEY_EXPIRED:
case OpenPgpSignatureResult.RESULT_INVALID_KEY_REVOKED:
case OpenPgpSignatureResult.RESULT_INVALID_SIGNATURE:
case OpenPgpSignatureResult.RESULT_NO_SIGNATURE:
case OpenPgpSignatureResult.RESULT_KEY_MISSING:
case OpenPgpSignatureResult.RESULT_VALID_UNCONFIRMED:
return small ? R.drawable.ic_warning_red_18dp : R.drawable.ic_warning_red_24dp;
case OpenPgpSignatureResult.RESULT_VALID_CONFIRMED:
return small ? R.drawable.ic_done_green_a700_18dp : R.drawable.ic_done_green_a700_24dp;
default:
return 0;
}
}
示例8: createOpenPgpResultAnnotation
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
public static CryptoResultAnnotation createOpenPgpResultAnnotation(OpenPgpDecryptionResult decryptionResult,
OpenPgpSignatureResult signatureResult, PendingIntent pendingIntent,
PendingIntent insecureWarningPendingIntent, MimeBodyPart replacementPart,
boolean overrideCryptoWarning) {
return new CryptoResultAnnotation(CryptoError.OPENPGP_OK, replacementPart,
decryptionResult, signatureResult, pendingIntent, insecureWarningPendingIntent, null,
overrideCryptoWarning);
}
示例9: handleOpenPgpOperationSuccess
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
private void handleOpenPgpOperationSuccess(MimeBodyPart outputPart) {
OpenPgpDecryptionResult decryptionResult =
currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_DECRYPTION);
OpenPgpSignatureResult signatureResult =
currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);
PendingIntent pendingIntent = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_INTENT);
PendingIntent insecureWarningPendingIntent = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_INSECURE_DETAIL_INTENT);
boolean overrideCryptoWarning = currentCryptoResult.getBooleanExtra(
OpenPgpApi.RESULT_OVERRIDE_CRYPTO_WARNING, false);
CryptoResultAnnotation resultAnnotation = CryptoResultAnnotation.createOpenPgpResultAnnotation(decryptionResult,
signatureResult, pendingIntent, insecureWarningPendingIntent, outputPart, overrideCryptoWarning);
onCryptoOperationSuccess(resultAnnotation);
}
示例10: multipartEncryptedOpenPgp_withOpenPgpApi__shouldCallOpenPgpApiAsync
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
@Test
public void multipartEncryptedOpenPgp_withOpenPgpApi__shouldCallOpenPgpApiAsync() throws Exception {
setUpWithOpenPgpApi();
Body encryptedBody = spy(new TextBody("encrypted data"));
Message message = messageFromBody(
multipart("encrypted", "protocol=\"application/pgp-encrypted\"",
bodypart("application/pgp-encrypted", "content"),
bodypart("application/octet-stream", encryptedBody)
)
);
message.setFrom(Address.parse("Test <[email protected]>")[0]);
OutputStream outputStream = mock(OutputStream.class);
Intent resultIntent = new Intent();
resultIntent.putExtra(OpenPgpApi.RESULT_CODE, OpenPgpApi.RESULT_CODE_SUCCESS);
OpenPgpDecryptionResult decryptionResult = mock(OpenPgpDecryptionResult.class);
resultIntent.putExtra(OpenPgpApi.RESULT_DECRYPTION, decryptionResult);
OpenPgpSignatureResult signatureResult = mock(OpenPgpSignatureResult.class);
resultIntent.putExtra(OpenPgpApi.RESULT_SIGNATURE, signatureResult);
PendingIntent pendingIntent = mock(PendingIntent.class);
resultIntent.putExtra(OpenPgpApi.RESULT_INTENT, pendingIntent);
processOpenPgpEncryptedMessageAndCaptureMocks(message, encryptedBody, outputStream);
MimeBodyPart decryptedPart = new MimeBodyPart(new TextBody("text"));
capturedOpenPgpCallback.onReturn(resultIntent, decryptedPart);
assertEquals(OpenPgpApi.ACTION_DECRYPT_VERIFY, capturedApiIntent.getAction());
assertEquals("[email protected]", capturedApiIntent.getStringExtra(OpenPgpApi.EXTRA_SENDER_ADDRESS));
assertPartAnnotationHasState(message, messageCryptoCallback, CryptoError.OPENPGP_OK, decryptedPart,
decryptionResult, signatureResult, pendingIntent, null, null, null);
verify(autocryptOperations).addAutocryptPeerUpdateToIntentIfPresent(message, capturedApiIntent);
verifyNoMoreInteractions(autocryptOperations);
}
示例11: CryptoResultAnnotation
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
private CryptoResultAnnotation(@NonNull CryptoError errorType, MimeBodyPart replacementData,
OpenPgpDecryptionResult openPgpDecryptionResult,
OpenPgpSignatureResult openPgpSignatureResult,
PendingIntent openPgpPendingIntent, OpenPgpError openPgpError) {
this.errorType = errorType;
this.replacementData = replacementData;
this.openPgpDecryptionResult = openPgpDecryptionResult;
this.openPgpSignatureResult = openPgpSignatureResult;
this.openPgpPendingIntent = openPgpPendingIntent;
this.openPgpError = openPgpError;
this.encapsulatedResult = null;
}
示例12: handleCryptoOperationSuccess
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
private void handleCryptoOperationSuccess(MimeBodyPart outputPart) {
OpenPgpDecryptionResult decryptionResult =
currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_DECRYPTION);
OpenPgpSignatureResult signatureResult =
currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_SIGNATURE);
PendingIntent pendingIntent = currentCryptoResult.getParcelableExtra(OpenPgpApi.RESULT_INTENT);
CryptoResultAnnotation resultAnnotation = CryptoResultAnnotation.createOpenPgpResultAnnotation(
decryptionResult, signatureResult, pendingIntent, outputPart);
onCryptoOperationSuccess(resultAnnotation);
}
示例13: setMessageWithOpenPgp
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
/**
* Used by MessageOpenPgpView
*/
public void setMessageWithOpenPgp(String decryptedData, OpenPgpSignatureResult signatureResult) {
try {
// TODO: get rid of PgpData?
PgpData data = new PgpData();
data.setDecryptedData(decryptedData);
data.setSignatureResult(signatureResult);
mMessageView.setMessage(mAccount, (LocalMessage) mMessage, data, mController, mListener);
} catch (MessagingException e) {
Log.e(K9.LOG_TAG, "displayMessageBody failed", e);
}
}
示例14: hasSignatureResult
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
public boolean hasSignatureResult() {
return (openPgpSignatureResult != null &&
openPgpSignatureResult.getResult() != OpenPgpSignatureResult.RESULT_NO_SIGNATURE) ||
(sMimeSignatureResult != null &&
sMimeSignatureResult.getResult() != SMimeSignatureResult.RESULT_NO_SIGNATURE);
}
示例15: getOpenPgpSignatureResult
import org.openintents.openpgp.OpenPgpSignatureResult; //导入依赖的package包/类
@Nullable
public OpenPgpSignatureResult getOpenPgpSignatureResult() {
return openPgpSignatureResult;
}