about summary refs log tree commit diff
path: root/app/services
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2016-10-12 21:07:00 +0200
committerEugen Rochko <eugen@zeonfederated.com>2016-10-12 21:07:00 +0200
commit64302b3c997b9b4f92ba8dbefec5988748b5b15a (patch)
tree0360a878652171229abde47619427ee6b19e2410 /app/services
parent160b5148ec3bfc84defa7b520ff29dd7ca6eec10 (diff)
Improve Friendica support (but still not there yet)
Diffstat (limited to 'app/services')
-rw-r--r--app/services/follow_remote_account_service.rb13
1 files changed, 2 insertions, 11 deletions
diff --git a/app/services/follow_remote_account_service.rb b/app/services/follow_remote_account_service.rb
index 43a598635..3334f751a 100644
--- a/app/services/follow_remote_account_service.rb
+++ b/app/services/follow_remote_account_service.rb
@@ -1,4 +1,6 @@
 class FollowRemoteAccountService < BaseService
+  include OStatus2::MagicKey
+
   # Find or create a local account for a remote user.
   # When creating, look up the user's webfinger and fetch all
   # important information from their feed
@@ -57,17 +59,6 @@ class FollowRemoteAccountService < BaseService
     update_remote_profile_service.call(author, account)
   end
 
-  def magic_key_to_pem(magic_key)
-    _, modulus, exponent = magic_key.split('.')
-    modulus, exponent = [modulus, exponent].map { |n| Base64.urlsafe_decode64(n).bytes.inject(0) { |a, e| (a << 8) | e } }
-
-    key   = OpenSSL::PKey::RSA.new
-    key.n = modulus
-    key.e = exponent
-
-    key.to_pem
-  end
-
   def update_remote_profile_service
     @update_remote_profile_service ||= UpdateRemoteProfileService.new
   end