use of co.krypt.krypton.pgp.publickey.SignedPublicKeySelfCertification in project krypton-android by kryptco.
the class PGPPublicKey method serialize.
@Override
public void serialize(DataOutputStream out) throws IOException {
publicKeyPacket.serialize(out);
for (SignedPublicKeySelfCertification identity : signedIdentities) {
identity.certification.userIDPacket.serialize(out);
identity.signature.serialize(out);
}
}
use of co.krypt.krypton.pgp.publickey.SignedPublicKeySelfCertification in project krypton-android by kryptco.
the class Notifications method notifyPGPKeyExportJob.
private static void notifyPGPKeyExportJob(Context context, PGPPublicKey pubkey) {
Intent clickIntent = new Intent(context, MainActivity.class);
if (new OnboardingProgress(context).inProgress()) {
clickIntent.setClass(context, OnboardingActivity.class);
}
clickIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_NEW_TASK);
PendingIntent clickPendingIntent = PendingIntent.getActivity(context, ("CLICK-PGPPUBKEY").hashCode(), clickIntent, PendingIntent.FLAG_UPDATE_CURRENT);
String userIDs = "";
for (SignedPublicKeySelfCertification signedIdentity : pubkey.signedIdentities) {
userIDs += signedIdentity.certification.userIDPacket.userID.toString() + "\n";
}
NotificationCompat.InboxStyle inboxStyle = new NotificationCompat.InboxStyle();
inboxStyle.setBigContentTitle("Exported PGP Public Key");
for (SignedPublicKeySelfCertification signedIdentity : pubkey.signedIdentities) {
inboxStyle.addLine(signedIdentity.certification.userIDPacket.userID.toString());
}
NotificationCompat.Builder mBuilder = buildNotification(context, APPROVED_CHANNEL_ID).setContentTitle("Exported PGP Public Key").setContentText(userIDs.trim()).setColor(ContextCompat.getColor(context, R.color.colorPrimary)).setPriority(NotificationCompat.PRIORITY_MAX).setCategory(NotificationCompat.CATEGORY_MESSAGE).setVisibility(NotificationCompat.VISIBILITY_PUBLIC).setContentIntent(clickPendingIntent).setAutoCancel(true).setStyle(inboxStyle);
if (!new Settings(context).silenceNotifications()) {
mBuilder.setDefaults(Notification.DEFAULT_SOUND).setVibrate(new long[] { 0, 100, 100, 100 });
}
NotificationManagerCompat mNotifyMgr = NotificationManagerCompat.from(context);
mNotifyMgr.notify(1, mBuilder.build());
}
Aggregations