encoder

package
v0.0.0-...-67ffaa3 Latest Latest
Warning

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

Go to latest
Published: May 28, 2019 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetPrettyCurveName

func GetPrettyCurveName(algo *asn1.ObjectIdentifier) string

GetPrettyCurveName for the provided object identifier

Types

type CryptoKey

type CryptoKey struct {
	Secret    []byte
	PublicKey []byte
	Algorithm *asn1.ObjectIdentifier
}

CryptoKey stores the fields needed to derive cryptocurrency specific sk, pk and pkh from a public key algorithm

func ParseAsn1EcKey

func ParseAsn1EcKey(der []byte, setOid *asn1.ObjectIdentifier) (*CryptoKey, error)

ParseAsn1EcKey parses DER encoded bytes using the ASN.1 EC structure, returning public/secret key material. The object identifier must be manually set when EC object is PKCS8 encoded Compare to: x509.ParseECPrivateKey()

func ParseAsn1Pkcs8Key

func ParseAsn1Pkcs8Key(der []byte) (*CryptoKey, error)

ParseAsn1Pkcs8Key parses DER encoded bytes using the ASN.1 PKCS8 structure and returns our public/secret keys material Compare to: x509.ParsePKCS8PrivateKey()

func ParseAsn1Pubkey

func ParseAsn1Pubkey(der []byte) (*CryptoKey, error)

ParseAsn1Pubkey parses DER encoded bytes using the ASN.1 Public Key structure and returns our public key material Compare to: x509.ParsePKIXPublicKey()

func ParsePEM

func ParsePEM(pemBytes []byte) (*CryptoKey, error)

ParsePEM and return the DER encoded ASN.1 bytes along with the ASN.1 type or error

type TezosKeys

type TezosKeys struct {
	SecretKey     string
	PublicKey     string
	PublicKeyHash string
	Curve         string
}

TezosKeys contains keys formatted specific to tezos reference binaries

func GetTezosKeys

func GetTezosKeys(pemBytes []byte) *TezosKeys

GetTezosKeys extracted from these PEM Bytes

Jump to

Keyboard shortcuts

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