From f40e2286faef696c25a81c04635aaf737606a39a Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Thu, 16 Feb 2017 02:17:03 +0100 Subject: lib --- lib/okpush/.gitignore | 3 + lib/okpush/apn.js | 57 +++ lib/okpush/db.js | 132 +++++++ lib/okpush/index.js | 120 +++++++ lib/okpush/package.json | 21 ++ lib/okpush/public/push.js | 31 ++ lib/okpush/templates/index.liquid | 74 ++++ lib/okpush/templates/partials/flash.liquid | 20 ++ lib/okpush/templates/partials/head.liquid | 13 + lib/okpush/templates/partials/inputs.liquid | 395 +++++++++++++++++++++ lib/okpush/templates/partials/tail.liquid | 14 + .../CertificateSigningRequest.certSigningRequest | 16 + lib/okpush/test_certs/Certificates.p12 | Bin 0 -> 3209 bytes lib/okpush/test_certs/aps_development.cer | Bin 0 -> 1421 bytes lib/okpush/test_certs/overlayer_dev_cert.pem | 32 ++ lib/okpush/test_certs/overlayer_dev_key.pem | 68 ++++ 16 files changed, 996 insertions(+) create mode 100644 lib/okpush/.gitignore create mode 100644 lib/okpush/apn.js create mode 100644 lib/okpush/db.js create mode 100644 lib/okpush/index.js create mode 100644 lib/okpush/package.json create mode 100644 lib/okpush/public/push.js create mode 100644 lib/okpush/templates/index.liquid create mode 100644 lib/okpush/templates/partials/flash.liquid create mode 100644 lib/okpush/templates/partials/head.liquid create mode 100644 lib/okpush/templates/partials/inputs.liquid create mode 100644 lib/okpush/templates/partials/tail.liquid create mode 100644 lib/okpush/test_certs/CertificateSigningRequest.certSigningRequest create mode 100644 lib/okpush/test_certs/Certificates.p12 create mode 100644 lib/okpush/test_certs/aps_development.cer create mode 100644 lib/okpush/test_certs/overlayer_dev_cert.pem create mode 100644 lib/okpush/test_certs/overlayer_dev_key.pem (limited to 'lib') diff --git a/lib/okpush/.gitignore b/lib/okpush/.gitignore new file mode 100644 index 00000000..e314c5fe --- /dev/null +++ b/lib/okpush/.gitignore @@ -0,0 +1,3 @@ + +node_modules + diff --git a/lib/okpush/apn.js b/lib/okpush/apn.js new file mode 100644 index 00000000..b6909f6f --- /dev/null +++ b/lib/okpush/apn.js @@ -0,0 +1,57 @@ + +var apn = require('apn') +var db = require('./db') +var apnProvider, apnFeedback + +function init (config) { + config.apn.connection.key = config.apn.key + config.apn.connection.cert = config.apn.cert + apnProvider = new apn.Provider(config.apn.connection) +} + +function push (note) { + db.getAllDevices(function(err, tokens){ + if (err) { + console.error("Error fetching devices:", err) + return + } + connection.send(note, tokens).then( function (response) { + // response.sent.forEach( function (token) { + // notificationSent(user, token) + // }) + response.failed.forEach( function (failure) { + if (failure.error) { + // A transport-level error occurred (e.g. network problem) + // notificationError(user, token, failure.error); + } else if (failure.status == 410) { + // `failure.status` is the HTTP status code + // `failure.response` is the JSON payload + // notificationFailed(token, failure.status, failure.response); + db.removeDevice(token) + } + }) + }) + }) +} + +function buildPayload (options, bundleId) { + var note = new apn.Notification() + note.topic = bundleId + if (options.expiry) + note.expiry = Math.floor(Date.now() / 1000) + options.expiry + if (options.alert) + note.alert = options.alert + if (options.badge) + note.badge = options.badge + if (options.payload) + note.payload = options.payload + if (options.sound) + note.sound = options.sound + return note +} + +module.exports = { + init: init, + push: push, + buildPayload: buildPayload +} diff --git a/lib/okpush/db.js b/lib/okpush/db.js new file mode 100644 index 00000000..844bccae --- /dev/null +++ b/lib/okpush/db.js @@ -0,0 +1,132 @@ +var mongoose = require('mongoose') +var findOrCreate = require('mongoose-findorcreate') +var _ = require('lodash') +var db, PushToken, Notification, Channel + +mongoose.Promise = require('bluebird') + +function init (config) { + db = mongoose.connect(config.mongodbUrl) + mongoose.connection.on('error', errorHandler) + + var pushTokenSchema = new db.Schema({ + type: { + type: 'String', + required: true, + lowercase: true, + enum: ['ios', 'android'], + }, + token: { + type: 'String', + required: true, + }, + channel: { + type: 'String', + required: true, + }, + }) + + var channelSchema = new db.Schema({ + channel: { + type: 'String', + required: true, + lowercase: true, + }, + last_push: { + type: 'Date', + required: true, + } + }) + channelSchema.plugin(findOrCreate); + + var notificationSchema = new db.Schema({ + channel: { + type: 'String', + required: true, + lowercase: true, + }, + date: { + type: 'Date', + required: true, + } + }) + + PushToken = db.model('PushToken', pushTokenSchema) + Notification = db.model('Notification', notificationSchema) + Channel = db.model('Channel', channelSchema) +} + +function errorHandler (error) { + console.error('ERROR: ' + error) +} + +/* devices / tokens */ + +function addToken (deviceType, token, channel) { + var pushItem = new PushToken({ + type: deviceType, + token: token, + channel: channel + }) + pushItem.save() +} +function getAllTokens (channel, cb) { + PushToken.find({ channel: channel }, function (err, items) { + if (err) return cb(err, null) + var items = _.map(items, function (item) { + return _.pick(item, ['type', 'token']) + }) + return cb(null, items) + }) +} +function removeToken (token, channel) { + PushToken.find({ token: token, channel: channel }).remove().exec() +} +function getDeviceCount (channel, cb) { + PushToken.count({ channel: channel }, cb) +} + +/* notifications */ + +function addNotification (channel, cb) { + var now = new Date + Channel.findOrCreate({channel: channel}, {last_push: now}, function(err, note, created) { + if (err) { + console.error("Error finding/creating notification", err) + cb(err, false) + return + } + else if (! created) { + note.last_push = now + note.save() + } + cb(null, note) + }) + new Notification ({ + channel: channel, + date: now, + }).save() +} +function getNotifications (cb) { + Notification.find(function (err, items) { + if (err) return cb(err, null) + + var items = _.map(items, function (item) { + return _.pick(item, ['channel', 'last_push']) + }) + + return cb(null, items) + }) +} + +/* wrap functions for some reason */ + +module.exports = { + init: init, + addToken: addToken, + removeToken: removeToken, + getAllTokens: getAllTokens, + getDeviceCount: getDeviceCount, + addNotification: addNotification, + getNotifications: getNotifications, +} \ No newline at end of file diff --git a/lib/okpush/index.js b/lib/okpush/index.js new file mode 100644 index 00000000..a9ba12eb --- /dev/null +++ b/lib/okpush/index.js @@ -0,0 +1,120 @@ +/** + * OKPush - Handles basic broadcast push notifications, as well as keeping track of tokens. + */ + +var path = require('path') +var passport = require('passport') +var DigestStrategy = require('passport-http').DigestStrategy; +var bodyParser = require('body-parser') +var OKTemplate = require('../../../app/node_modules/oktemplate') +var apn = require('./apn') +var db = require('./db') + +passport.use(new DigestStrategy({qop: 'auth'}, function authenticate(username, done) { + if (!process.env.OK_USER || !process.env.OK_PASS) { + return done(new Error('No user or pass configured on server')) + } else { + return done(null, process.env.OK_USER, process.env.OK_PASS) + } +})) + +function OKPush (options) { + if (!(this instanceof OKPush)) return new OKPush(options) + options = options || {} + if (!options.express) + throw new Error('Express not provided to OKPush') + if (!options.config) + throw new Error('Configuration not provided to OKPush') + if (!options.config.notifications) + throw new Error('Notifications not provided to OKPush') + if (!options.config.bundleId) + throw new Error('bundleId not provided to OKPush') + if (!options.config.mongodbUrl) + throw new Error('mongodbUrl not provided to OKPush') + + var express = options.express + var router = express.Router() + var config = options.config + var meta = options.meta + var error = options.errorHandler + // var okcms_db = options.db + + var templateProvider = this._templateProvider = new OKTemplate({ + root: path.join(__dirname, './templates'), + debug: meta.debug + }) + + var templates = {} + templates['index'] = templateProvider.getTemplate('index') + + apn.init(config) + db.init(config) + + router.use('/admin/', passport.initialize()) + router.use('/public/', express.static(path.join(__dirname, './public'))); + + // monkeypatch because of app.use(router) .. obnoxious + router.all('/admin/(:path*)?', function (req, res, next) { + req.newUrl = req.url + req.url = req.originalUrl + next() + }) + router.all('/admin/(:path*)?', passport.authenticate('digest', { + session: false + })) + router.all('/admin/(:path*)?', function (req, res, next) { + req.url = req.newUrl + next() + }) + + // pass in admin middleware! + router.get('/admin', function (req, res) { + db.getNotifications(function(err, notes){ + db.getDeviceCount(function(err, count){ + var data = { + meta: meta, + notifications: config.notifications, + device_count: count, + } + notes.forEach(function(note){ + if (note.key in data.notifications) { + data.notifications[ note.key ].last_push = note.last_push + } + }) + templates['index'].render(data).then(function(rendered) { + res.send(rendered); + }).fail(error(req, res, 500)) + }) + }) + }) + + router.post('/send', bodyParser.urlencoded({ extended: false }), function (req, res) { + var key = req.body.key + var opt = options.config.notifications[key] + var note = apn.buildPayload(opt, options.config.bundleId) + // apn.push(note) + db.updateNotification(key, function(){ + res.send(200) + }) + }) + + // should work without middleware + router.post('/add', function (req, res) { + // add a key + db. + registrationId: localStorage.getItem("yoox.registrationId"), + channel: channel, + platform, + }) + router.post('/remove', function (req, res) { + // remove a key + }) + + this._router = router +} + +OKPush.prototype.middleware = function () { + return this._router +} + +module.exports = OKPush diff --git a/lib/okpush/package.json b/lib/okpush/package.json new file mode 100644 index 00000000..87ca92ca --- /dev/null +++ b/lib/okpush/package.json @@ -0,0 +1,21 @@ +{ + "name": "okpush", + "version": "1.0.0", + "description": "push notification service", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "okfocus ", + "license": "LNT", + "dependencies": { + "apn": "^2.1.1", + "bluebird": "^3.4.6", + "body-parser": "^1.15.2", + "lodash": "^4.16.3", + "mongoose": "^4.6.2", + "mongoose-findorcreate": "^0.1.2", + "passport": "^0.3.2", + "passport-http": "^0.3.0" + } +} diff --git a/lib/okpush/public/push.js b/lib/okpush/public/push.js new file mode 100644 index 00000000..d369c903 --- /dev/null +++ b/lib/okpush/public/push.js @@ -0,0 +1,31 @@ +$(function(){ + var count = $(".device-count").data("count"); + var confirm_msg = "This will send the notification {{key}} to {{count}} people. Click OK to confirm."; + $(".notifications button").click(function(){ + var $el = $(this) + var data = $el.data() + var msg = confirm_msg.replace("{{key}}", data.key).replace("{{count}}", count) + if (! confirm(msg)) return + $.ajax({ + type: "POST", + url: "/_services/push/send", + data: { key: data.key }, + success: function(){ + alert("Push notification sent.") + var now = new Date() + // "%a %d-%b-%Y %H:%M" + var months = "Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec".split(" ") + var days = "Sun Mon Tue Wed Thu Fri Sat".split(" ") + var date = days[ now.getDay() ] + date += " " + now.getDate() + date += "-" + months[now.getMonth()] + date += "-" + now.getFullYear() + date += " " + now.getHours() + var mins = now.getMinutes() + if (mins < 10) mins = "0" + mins + date += ":" + mins + $el.closest("tr").find(".notification-date").html(date) + } + }) + }) +}) \ No newline at end of file diff --git a/lib/okpush/templates/index.liquid b/lib/okpush/templates/index.liquid new file mode 100644 index 00000000..10772b55 --- /dev/null +++ b/lib/okpush/templates/index.liquid @@ -0,0 +1,74 @@ +{% include 'partials/head' %} + +{% include 'partials/flash' %} + + + + + +
+ +

Push Notifications

+ +
Device count: {{ device_count }}
+ + + + + + + + + {% for pair in notifications %} + {% assign name = pair[0] %} + {% assign spec = pair[1] %} + + + + + + + {% endfor %} +
KeyMessageLast Push
+ {{name | escape}} + + {{spec.alert}} + + {% unless spec.last_push %} + Never + {% else %} + {{ spec.last_push | date: "%a %d-%b-%Y %H:%M" }} + {% endunless %} + + +
+ +
+ +{% include 'partials/tail' %} + + \ No newline at end of file diff --git a/lib/okpush/templates/partials/flash.liquid b/lib/okpush/templates/partials/flash.liquid new file mode 100644 index 00000000..e51a86b7 --- /dev/null +++ b/lib/okpush/templates/partials/flash.liquid @@ -0,0 +1,20 @@ +{% if success.length > 0 %} +
+
Changes saved.
+ +
+{% endif %} + +{% if errors.length > 0 %} +
+ {% for error in errors %} +
+
{{error.message}}
+
+ {% endfor %} +
+{% endif %} \ No newline at end of file diff --git a/lib/okpush/templates/partials/head.liquid b/lib/okpush/templates/partials/head.liquid new file mode 100644 index 00000000..e9c27dc0 --- /dev/null +++ b/lib/okpush/templates/partials/head.liquid @@ -0,0 +1,13 @@ + + + + + {{meta.project}} Admin + + + +
+ {{meta.project}} Admin + View Site +
+
\ No newline at end of file diff --git a/lib/okpush/templates/partials/inputs.liquid b/lib/okpush/templates/partials/inputs.liquid new file mode 100644 index 00000000..60466de9 --- /dev/null +++ b/lib/okpush/templates/partials/inputs.liquid @@ -0,0 +1,395 @@ +{% for pair in resource.spec %} + {% assign name = pair[0] %} + {% assign spec = pair[1] %} + {% assign type = spec.type %} + +
+ + + {% if type == 'string' %} + + {% elsif type == 'text' %} + + {% elsif type == 'number' %} + + {% elsif type == 'enum' or type == 'foreign-key' %} + + {% elsif type == 'video' %} +
+ + + + + + + + + +
+ {% elsif type == 'image' %} +
+
+
+ + +
+ +
+
+ + + + + {{spec.value.caption | escape}} + +
+
+ + {% elsif type == 'date' %} + +
+ +
+ + {% elsif type == 'flag' %} + +
+ +
+ + {% elsif type == 'tag-list' %} +
+ +
+ + {% elsif type == 'link-list' %} + + + {% elsif type == 'media-list' or type == 'media' %} +
+
+
+ + +
+ +
+ + + + + + + + + +
    + {% for image in spec.value %} + {% if image.type and (image.type == "vimeo" or image.type == "youtube" or image.type == "video") %} +
  1. +
    + + + + + + + + + + + + + + + +
    + + +
  2. + {% elsif image.type and (image.type == "audio" or image.type == "soundcloud") %} +
  3. +
    + + + + + + + + +
    + + +
  4. + {% elsif image.type and image.type == "link" %} + + {% else %} +
  5. + + + + + + + {{image.caption | strip_html}} + +
  6. + {% endif %} + {% endfor %} +
+
+ {% elsif type == 'captioned-image-list' or type == 'gallery' %} +
+
+
+ + +
+ +
+ + + +
    + {% for image in spec.value %} +
  1. + + + + + {{image.caption | strip_html}} + +
  2. + {% endfor %} +
+
+ {% elsif type == 'double-captioned-image-list' %} +
+
+
+ + +
+ +
+ + + +
    + {% for image in spec.value %} +
  1. + {{image.caption | strip_html}} + + + + + + +
  2. + {% endfor %} +
+
+ {% elsif type == 'triple-captioned-image-list' %} +
+
+
+ + +
+ +
+ + + +
    + {% for image in spec.value %} +
  1. + {{image.caption | strip_html}} + + + + + + + +
  2. + {% endfor %} +
+
+ {% elsif type == 'meta' %} + + {% else %} +

Admin template doesn't support '{{type}}' properties!

+ {% endif %} +
+ +{% endfor %} diff --git a/lib/okpush/templates/partials/tail.liquid b/lib/okpush/templates/partials/tail.liquid new file mode 100644 index 00000000..522023b5 --- /dev/null +++ b/lib/okpush/templates/partials/tail.liquid @@ -0,0 +1,14 @@ +
{% comment %} closes container tag {% endcomment %} +
+
+ + + + + + + + diff --git a/lib/okpush/test_certs/CertificateSigningRequest.certSigningRequest b/lib/okpush/test_certs/CertificateSigningRequest.certSigningRequest new file mode 100644 index 00000000..3a4074ae --- /dev/null +++ b/lib/okpush/test_certs/CertificateSigningRequest.certSigningRequest @@ -0,0 +1,16 @@ +-----BEGIN CERTIFICATE REQUEST----- +MIICkjCCAXoCAQAwTTEdMBsGCSqGSIb3DQEJARYOanVsZXNAb2tmb2MudXMxHzAd +BgNVBAMMFkp1bGlhbiBMYXBsYWNlIERFViBLRVkxCzAJBgNVBAYTAlVTMIIBIjAN +BgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEArrpXz8B0q/tJ2+N6gjK2zLNPIIlA +lzrE46TIkY10xo9jW3vBRgZL9V5xKtmCWf3KfR2I7KioyqqnZvz6++TV/M3rZptJ +XN8yMmG4mjTqgC1V2SubYyUZqpqkfyLK1ePimsg09UUNxwNcIyBJun+f8wXqz7HK +Kieiq+d7oTs+WJbWdkIftxe7hjL2n93PI1LLCF15Cx8s7XP7R7QsTGMvHUzYYHiL +4bc+r54jpZ28onVAwdYx+p3WkKzdFGjkrIl++IXmyJr0E7jilfrKwMWi4tvCKgXV +KH6VmWLIKOtfKVMdIK0WQ9ij3kRHfEwgN/djC3M2UWFEGLx1d7FuL5c+nQIDAQAB +oAAwDQYJKoZIhvcNAQELBQADggEBAIGOwvuW7HaOb1h+nkpIDTHNRN6Lw3MTg8nU +68skeSFatC8lC4e//Gsl1z8iyR7amhoMrZ29f4Tgs5w8NFgcVmzdp5CL126WA3qV +Qu+xZxhgwUnLRxtpDUVtTdJGaYNmowpm4mqs5YFg6WCIhWg+kuEJJ8MSOkYHtyAx +HIpbfjeSW69VGelr+vGZ6Jf07UCquwJCJR4WmsIyruJhvf2CQMPsT3bXKrhu/sWg +WyjjCjXVLeDOO/tiRMnPteCcDZPsXKyi9PPkSF4u591YoUL0UxjlzlignBT4FSyq +s8kdmrEHWIW1BAscmNVny2YTuGjbFos/GBSMDeJvoXdvPS2kRiQ= +-----END CERTIFICATE REQUEST----- diff --git a/lib/okpush/test_certs/Certificates.p12 b/lib/okpush/test_certs/Certificates.p12 new file mode 100644 index 00000000..6e61158f Binary files /dev/null and b/lib/okpush/test_certs/Certificates.p12 differ diff --git a/lib/okpush/test_certs/aps_development.cer b/lib/okpush/test_certs/aps_development.cer new file mode 100644 index 00000000..8d55dd44 Binary files /dev/null and b/lib/okpush/test_certs/aps_development.cer differ diff --git a/lib/okpush/test_certs/overlayer_dev_cert.pem b/lib/okpush/test_certs/overlayer_dev_cert.pem new file mode 100644 index 00000000..3758dd23 --- /dev/null +++ b/lib/okpush/test_certs/overlayer_dev_cert.pem @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIIFiTCCBHGgAwIBAgIIaNpEjSUbbWwwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV +BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js +ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3 +aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw +HhcNMTYxMDA0MjAxMTM3WhcNMTcxMDA0MjAxMTM3WjCBiDEiMCAGCgmSJomT8ixk +AQEMEnVzLm9rZm9jLm92ZXJsYXllcjFAMD4GA1UEAww3QXBwbGUgRGV2ZWxvcG1l +bnQgSU9TIFB1c2ggU2VydmljZXM6IHVzLm9rZm9jLm92ZXJsYXllcjETMBEGA1UE +CwwKNUVIOVc1WDVTSjELMAkGA1UEBhMCVVMwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQCuulfPwHSr+0nb43qCMrbMs08giUCXOsTjpMiRjXTGj2Nbe8FG +Bkv1XnEq2YJZ/cp9HYjsqKjKqqdm/Pr75NX8zetmm0lc3zIyYbiaNOqALVXZK5tj +JRmqmqR/IsrV4+KayDT1RQ3HA1wjIEm6f5/zBerPscoqJ6Kr53uhOz5YltZ2Qh+3 +F7uGMvaf3c8jUssIXXkLHyztc/tHtCxMYy8dTNhgeIvhtz6vniOlnbyidUDB1jH6 +ndaQrN0UaOSsiX74hebImvQTuOKV+srAxaLi28IqBd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j1l7Tlps6QG6/r +4CsJBIfpGjxwznrYJBN5ox1KlFxNLwD3UNpLhOQ= +-----END CERTIFICATE----- diff --git a/lib/okpush/test_certs/overlayer_dev_key.pem b/lib/okpush/test_certs/overlayer_dev_key.pem new file mode 100644 index 00000000..30cb696d --- /dev/null +++ b/lib/okpush/test_certs/overlayer_dev_key.pem @@ -0,0 +1,68 @@ +Bag Attributes + friendlyName: Apple Development IOS Push Services: us.okfoc.overlayer + localKeyID: 72 44 9B 21 2C C7 EC F4 C4 ED 1F 60 B0 86 FF B3 12 B3 1E B8 +subject=/UID=us.okfoc.overlayer/CN=Apple Development IOS Push Services: us.okfoc.overlayer/OU=5EH9W5X5SJ/C=US +issuer=/C=US/O=Apple Inc./OU=Apple Worldwide Developer Relations/CN=Apple Worldwide Developer Relations Certification Authority +-----BEGIN CERTIFICATE----- +MIIFiTCCBHGgAwIBAgIIaNpEjSUbbWwwDQYJKoZIhvcNAQEFBQAwgZYxCzAJBgNV +BAYTAlVTMRMwEQYDVQQKDApBcHBsZSBJbmMuMSwwKgYDVQQLDCNBcHBsZSBXb3Js +ZHdpZGUgRGV2ZWxvcGVyIFJlbGF0aW9uczFEMEIGA1UEAww7QXBwbGUgV29ybGR3 +aWRlIERldmVsb3BlciBSZWxhdGlvbnMgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkw +HhcNMTYxMDA0MjAxMTM3WhcNMTcxMDA0MjAxMTM3WjCBiDEiMCAGCgmSJomT8ixk +AQEMEnVzLm9rZm9jLm92ZXJsYXllcjFAMD4GA1UEAww3QXBwbGUgRGV2ZWxvcG1l +bnQgSU9TIFB1c2ggU2VydmljZXM6IHVzLm9rZm9jLm92ZXJsYXllcjETMBEGA1UE +CwwKNUVIOVc1WDVTSjELMAkGA1UEBhMCVVMwggEiMA0GCSqGSIb3DQEBAQUAA4IB +DwAwggEKAoIBAQCuulfPwHSr+0nb43qCMrbMs08giUCXOsTjpMiRjXTGj2Nbe8FG +Bkv1XnEq2YJZ/cp9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DEMQpaJRbir9Fx6WcZQ4GB72iZ1M/1fkC +79Yq17yzxM9Awf2igx1EkZhzy6Oq+7cUX9Jbz5IQrPyfXe5hpaOmY4jnWgSlaiwJ +6bBhFHwhJY9ekAFOyRnZS7hQD4mLOBZLti/lH4Z2zadd21DbM/uhUvLJgYpIRplP +hoFxV5bev5vv9A0dbYw6ERa3+aG8HHmP9N4u1/JxHIX2VlYzzLj1l7Tlps6QG6/r +4CsJBIfpGjxwznrYJBN5ox1KlFxNLwD3UNpLhOQ= +-----END CERTIFICATE----- +Bag Attributes + friendlyName: Julian Laplace DEV KEY + localKeyID: 72 44 9B 21 2C C7 EC F4 C4 ED 1F 60 B0 86 FF B3 12 B3 1E B8 +Key Attributes: +-----BEGIN RSA PRIVATE KEY----- +MIIEpAIBAAKCAQEArrpXz8B0q/tJ2+N6gjK2zLNPIIlAlzrE46TIkY10xo9jW3vB +RgZL9V5xKtmCWf3KfR2I7KioyqqnZvz6++TV/M3rZptJXN8yMmG4mjTqgC1V2Sub +YyUZqpqkfyLK1ePimsg09UUNxwNcIyBJun+f8wXqz7HKKieiq+d7oTs+WJbWdkIf +txe7hjL2n93PI1LLCF15Cx8s7XP7R7QsTGMvHUzYYHiL4bc+r54jpZ28onVAwdYx ++p3WkKzdFGjkrIl++IXmyJr0E7jilfrKwMWi4tvCKgXVKH6VmWLIKOtfKVMdIK0W +Q9ij3kRHfEwgN/djC3M2UWFEGLx1d7FuL5c+nQIDAQABAoIBAQCdKIiBGccXRa/a +MxJm9zyKhCGAz1MkczzS0M2Cdax6SFCC4Z4m4NUDfw3lD7z6Opcd0CnvS4h+ud5W +eOc7GEoM2B6KrNPgz/Szckf7k+r0nVJhQqLCG4WpeOzKWb39grq4o6lWjuTkgzYl +dg46zD5O9ZyNcYm4PuxHGK+Phtz+CjkEx5Y6WqoBvgA10A+pHBSMAZ2uRznGHJmQ +xF9HHdLLKwtZemRGEdZaC510fpBDbgapLzZqy495/2I3zlOFSW9thWhJ/PO45AH1 +b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