Skip to content

EdDSA using PEM keys generated by OpenSSL Ed25519 #862

Answered by Slamdunk
igor-davidov asked this question in Q&A
Discussion options

You must be logged in to vote

I am satisfied with using ECDSA.

EdDSA keys are better 😉

@jedisct1 suggestion is easy:

$ openssl genpkey -algorithm ed25519 -out test-priv.pem
$ openssl pkey -in test-priv.pem -pubout -out test-pub.pem
$ openssl pkey -in test-priv.pem -outform DER | tail -c 32 > test-priv.binary
$ openssl pkey -pubin -in test-pub.pem -outform DER | tail -c 32 > test-pub.binary
$ cat <<'EOF' | php
<?php
var_dump(
    file_get_contents("test-pub.binary")
    ===
    sodium_crypto_sign_publickey(
        sodium_crypto_sign_seed_keypair(
            file_get_contents("test-priv.binary")
        )
    )
);
EOF

Standard input code:7:
bool(true)

when doing Composer install "lcobucci\jwt\src\JwtFacade.php" w…

Replies: 10 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Slamdunk
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #861 on August 11, 2022 09:32.