public_key_serializer.rb 358 B

12345678910111213141516171819
  1. # frozen_string_literal: true
  2. class ActivityPub::PublicKeySerializer < ActivityPub::Serializer
  3. context :security
  4. attributes :id, :owner, :public_key_pem
  5. def id
  6. ActivityPub::TagManager.instance.key_uri_for(object)
  7. end
  8. def owner
  9. ActivityPub::TagManager.instance.uri_for(object)
  10. end
  11. def public_key_pem
  12. object.public_key
  13. end
  14. end