crypto

package
v0.2.10 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2023 License: Apache-2.0 Imports: 9 Imported by: 3

Documentation

Overview

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Copyright IBM Corp. All Rights Reserved. SPDX-License-Identifier: Apache-2.0

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComputeSHA256Hash

func ComputeSHA256Hash(msgBytes []byte) ([]byte, error)

func ConcatenateHashes

func ConcatenateHashes(h1, h2 []byte) ([]byte, error)

Concatenate two hashes and calculate hash of result QLDB style

Types

type KeyLoader

type KeyLoader struct {
}

KeyLoader load private keys from given file path

func (*KeyLoader) Load

func (k *KeyLoader) Load(keyPEMBlock []byte) (crypto.PrivateKey, error)

Load key and returns instance, supports SEC1 EC and PKCS#8 Based on crypto/tls/tls.go

type Signer

type Signer interface {
	Sign(msgBytes []byte) ([]byte, error)
	Identity() string
}

Signer is cryptographic primitive used only to sign messages. Each entity usually access single Signer

func NewSigner

func NewSigner(opt *SignerOptions) (Signer, error)

type SignerOptions

type SignerOptions struct {
	Identity    string
	KeyFilePath string
}

SignerOptions - crypto data location

type Verifier

type Verifier struct {
	Certificate *x509.Certificate
}

Verifier is cryptographic primitive used only to validate message signature, each node usually access multiple Verifiers.

func NewVerifier

func NewVerifier(rawCert []byte) (*Verifier, error)

NewVerifier creates Verifier from shared root certificates pool and raw verifying entity certificate.

func (*Verifier) Verify

func (v *Verifier) Verify(msgBytes []byte, signature []byte) error

Verify verifies signature

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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