utils

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2024 License: MIT Imports: 21 Imported by: 1

Documentation

Index

Constants

View Source
const PemBlockType = "CERTIFICATE"

Variables

View Source
var ErrUnsupportedPublicKey = errors.New("unsupported public key, supported formats: rsa, ecdsa")

Functions

func ExtractPubKeys

func ExtractPubKeys(certs []*x509.Certificate) ([][]byte, error)

ExtractPubKeys extracts raw data of public keys from certificates, which can be used for hashing later.

func FetchHashLeavesFromCosmos

func FetchHashLeavesFromCosmos(client treeClient) ([][]byte, error)

func HashCertificate

func HashCertificate(certificate *x509.Certificate) ([]byte, error)

HashCertificate hashes the public key of the certificate

func NewGRPCClient

func NewGRPCClient(addr string, isSecure bool) (*grpc.ClientConn, error)

func ParseCertificatesCollection

func ParseCertificatesCollection(data []byte) ([]*x509.Certificate, error)

func ParsePemKey

func ParsePemKey(rawPemKey string) (*x509.Certificate, error)

func ParsePemKeys

func ParsePemKeys(rawPemBlocks []string) ([]*x509.Certificate, error)

func To32Bytes

func To32Bytes(arr []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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