Skip to content

Export raw Ed25519 key? #3000

@justablob

Description

@justablob

I'm trying to export an Ed25519 private key without any PEM/DER encoding around it but i'm kind of struggling:

key.export({ type: "pkcs8", format: "der" })

gives me a 48-byte Buffer (which makes sense, it's ASN1, not the raw key), but that makes me wonder if there's any way to get the raw 32-byte private key. I could probably use some ASN1 library to get it from the DER Buffer but that's a little convoluted. It's possible that I'm completely missing something here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions