Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7687703
keys_test.exs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
657 B
Referenced Files
None
Subscribers
None
keys_test.exs
View Options
# Pleroma: A lightweight social networking server
# Copyright © 2017-2019 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule
Pleroma.KeysTest
do
use
Pleroma.DataCase
alias
Pleroma.Keys
test
"generates an RSA private key pem"
do
{
:ok
,
key
}
=
Keys
.
generate_rsa_pem
()
assert
is_binary
(
key
)
assert
Regex
.
match?
(
~r/RSA/
,
key
)
end
test
"returns a public and private key from a pem"
do
pem
=
File
.
read!
(
"test/fixtures/private_key.pem"
)
{
:ok
,
private
,
public
}
=
Keys
.
keys_from_pem
(
pem
)
assert
elem
(
private
,
0
)
==
:RSAPrivateKey
assert
elem
(
public
,
0
)
==
:RSAPublicKey
end
end
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Sep 3, 11:08 PM (1 d, 7 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
313633
Default Alt Text
keys_test.exs (657 B)
Attached To
Mode
rPUBE pleroma-upstream
Attached
Detach File
Event Timeline
Log In to Comment