dint-dev / cryptography

Cryptography for Flutter developers: encryption, digital signatures, key agreement, etc.
https://pub.dev/packages/cryptography
Apache License 2.0
155 stars 75 forks source link

How do I sign a message using a PEM key created by OpenSSL with the ED25519 algorithm? #185

Open xinlake opened 1 week ago

xinlake commented 1 week ago

I created an ED25519 PEM key using OpenSSL:

openssl genpkey -algorithm ED25519 -outform PEM -out ed15519.pem

The content of the PEM file may look like this:

-----BEGIN PRIVATE KEY-----
MC4CAQAwBQYDK2VwBCIEIIbOW5Du0BZgisHQLHJ7vxwpThZLsUJfK5a2gf/BvfwH
-----END PRIVATE KEY-----

Next, how do I sign a message using the cryptography library?