kx509

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2024 License: MIT Imports: 15 Imported by: 1

Documentation

Overview

Pakcage kx509 supports marshaling and unmarshaling of EC-KCDSA and KCDSA private/public keys.

Warning: It is no nomative.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MarshalECKCPrivateKey

func MarshalECKCPrivateKey(key *eckcdsa.PrivateKey) ([]byte, error)

MarshalECKCPrivateKey converts an EC private key to SEC 1, ASN.1 DER form.

This kind of key is commonly encoded in PEM blocks of type "EC PRIVATE KEY". For a more flexible key format which is not EC specific, use MarshalPKCS8PrivateKey.

warning: this is non-normative

func MarshalPKCS8PrivateKey

func MarshalPKCS8PrivateKey(key interface{}) ([]byte, error)

MarshalPKCS8PrivateKey converts a private key to PKCS #8, ASN.1 DER form.

supported key types : *eckcdsa.PublicKey and *kcdsa.PublicKey. for unsupported types, returns the result of crypto/x509.MarshalPKCS8PrivateKey

This kind of key is commonly encoded in PEM blocks of type "PRIVATE KEY".

func MarshalPKIXPublicKey

func MarshalPKIXPublicKey(pub interface{}) ([]byte, error)

MarshalPKIXPublicKey converts a public key to PKIX, ASN.1 DER form.

supported key types : *eckcdsa.PublicKey and *kcdsa.PublicKey. for unsupported types, returns the result of crypto/x509.MarshalPKIXPublicKey

This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY".

func ParseECKCPrivateKey

func ParseECKCPrivateKey(der []byte) (*eckcdsa.PrivateKey, error)

ParseECKCPrivateKey parses an EC private key in SEC 1, ASN.1 DER form.

This kind of key is commonly encoded in PEM blocks of type "EC PRIVATE KEY".

warning: this is non-normative

func ParsePKCS8PrivateKey

func ParsePKCS8PrivateKey(der []byte) (key interface{}, err error)

ParsePKCS8PrivateKey parses an unencrypted private key in PKCS #8, ASN.1 DER form.

It returns an *eckcdsa.PrivateKey, an *kcdsa.PrivateKey, or the result of crypto/x509.ParsePKCS8PrivateKey

This kind of key is commonly encoded in PEM blocks of type "PRIVATE KEY".

func ParsePKIXPublicKey

func ParsePKIXPublicKey(derBytes []byte) (pub interface{}, err error)

ParsePKIXPublicKey parses a public key in PKIX, ASN.1 DER form.

It returns an *eckcdsa.PublicKey, an *kcdsa.PublicKey, or the result of crypto/x509.ParsePKIXPublicKey

This kind of key is commonly encoded in PEM blocks of type "PUBLIC KEY".

Types

This section is empty.

Jump to

Keyboard shortcuts

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