key_utils

package
v2.2.2+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2015 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package key_utils provides methods to generate keys and retrieve bitpay specific ids (the SIN) and correctly formatted signatures.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExtractCompressedPublicKey

func ExtractCompressedPublicKey(pm string) string

ExtractCompressedPublicKey returns a hexadecimal encoding of the compressed public key. It expects a pem string as the argument.

func ExtractKeyFromPem

func ExtractKeyFromPem(pm string) *btcec.PrivateKey

Returns a btec.Private key object if provided a correct secp256k1 encoded pem.

func GeneratePem

func GeneratePem() string

All BitPay clients use a PEM file to store the private and public keys.

func GenerateSinFromPem

func GenerateSinFromPem(pm string) string

GenerateSinFromPem returns a base58 encoding of a public key. It expects a pem string as the argument.

func Sign

func Sign(message string, pm string) string

Returns a hexadecimal encoding of the signed sha256 hash of message, using the key provide in the pem string pm.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL