dint-dev / cryptography

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

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

Open xinlake opened 5 months ago

xinlake commented 5 months 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?