Skip to content

Provide to_sec1_bytes for PublicKey #1101

@KizzyCode

Description

@KizzyCode

Is there a reason why there is no to_sec1_bytes-method?

To parse a SEC 1 representation, we have PublicKey::from_sec1_bytes – however to serialize into a SEC 1 representation we need to detour via EncodedPoint::from(&public_key) and then use encoded_point.as_bytes(). Once you know this, it is pretty trivial – however it took me a few minutes to get there and its not that obvious IMO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions