mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-10 19:29:11 +00:00
activitypub: switch to using x509 representation for public keys instead of pkcs#1
This commit is contained in:
parent
d386e8a825
commit
8546551257
2 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ defmodule Pleroma.Web.ActivityPub.UserView do
|
||||||
def render("user.json", %{user: user}) do
|
def render("user.json", %{user: user}) do
|
||||||
{:ok, user} = WebFinger.ensure_keys_present(user)
|
{:ok, user} = WebFinger.ensure_keys_present(user)
|
||||||
{:ok, _, public_key} = Salmon.keys_from_pem(user.info["keys"])
|
{:ok, _, public_key} = Salmon.keys_from_pem(user.info["keys"])
|
||||||
public_key = :public_key.pem_entry_encode(:RSAPublicKey, public_key)
|
public_key = :public_key.pem_entry_encode(:SubjectPublicKeyInfo, public_key)
|
||||||
public_key = :public_key.pem_encode([public_key])
|
public_key = :public_key.pem_encode([public_key])
|
||||||
|
|
||||||
%{
|
%{
|
||||||
|
|
|
@ -13,6 +13,6 @@ defmodule Pleroma.Web.ActivityPub.UserViewTest do
|
||||||
assert result["id"] == user.ap_id
|
assert result["id"] == user.ap_id
|
||||||
assert result["preferredUsername"] == user.nickname
|
assert result["preferredUsername"] == user.nickname
|
||||||
|
|
||||||
assert String.contains?(result["publicKey"]["publicKeyPem"], "BEGIN RSA PUBLIC KEY")
|
assert String.contains?(result["publicKey"]["publicKeyPem"], "BEGIN PUBLIC KEY")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue