client

package
v0.0.0-...-07d6e5f Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: LGPL-3.0 Imports: 20 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Enter = []byte("\n")

Enter asci character LF.

Functions

func CreateSignature

func CreateSignature(foldedPublicKeys, privateKeyContent, message, caseIdentifier []byte, outFormat string) (int, []byte)

CreateSignature creates signature and encode it into DER or PEM.

func DerivePublicKey

func DerivePublicKey(encodedPrivateKey []byte, format string) (int, []byte)

DerivePublicKey derives public key from private.

func EncodeSignarureToDER

func EncodeSignarureToDER(signature *ring.Signature) (int, []byte)

EncodeSignarureToDER encodes signature to DER.

func EncodeSignarureToPEM

func EncodeSignarureToPEM(signature *ring.Signature) (int, []byte)

EncodeSignarureToPEM encodes signature to PEM.

func FoldPublicKeys

func FoldPublicKeys(pubKeysContent [][]byte, hashName, format, order string) (int, []byte)

FoldPublicKeys create sequence of public keys coordinates.

func FormatDigest

func FormatDigest(text string) string

FormatDigest makes digest more human readable: 'c29da7' -> 'c2:9d:a7' openssl dgst -c -sha3-256 $curve-digests.txt | cut -d ' ' -f2

func GeneratePrivateKey

func GeneratePrivateKey(curveName, format string) (int, []byte)

GeneratePrivateKey generate private key and encode it to the required format.

func LoadFolder

func LoadFolder(folder string) [][]byte

LoadFolder read all files from the folder.

func ParsePrivateKey

func ParsePrivateKey(content []byte) (int, *ecdsa.PrivateKey)

ParsePrivateKey parses private key from bytes.

func ParseSignature

func ParseSignature(content []byte) (int, ring.Signature)

ParseSignature parses signature in format PEM or DER.

func PublicKeyXYCoordinates

func PublicKeyXYCoordinates(pubicKey []byte) (int, []byte)

PublicKeyXYCoordinates outputs public key coordinates X, Y.

func PublicKeysDigest

func PublicKeysDigest(foldedPublicKeys []byte, separator bool) (int, []byte)

PublicKeysDigest outputs public keys digest.

func ReadFromFileOrStdin

func ReadFromFileOrStdin(sourceName string) []byte

ReadFromFileOrStdin reads from file or stdin.

func ReadMessage

func ReadMessage(messageOrFilename string) []byte

ReadMessage reads message from the file or use param as a message.

func SignatureKeyImage

func SignatureKeyImage(body []byte, separator bool) (int, []byte)

SignatureKeyImage outputs signature key image.

func UnfoldPublicKeysContent

func UnfoldPublicKeysContent(content []byte) (int, []*ecdsa.PublicKey, ring.FoldedPublicKeys)

UnfoldPublicKeysContent restore public keys from sequence.

func UnfoldPublicKeysIntoBytes

func UnfoldPublicKeysIntoBytes(foldedPublicKeys []byte, outFormat string) (int, [][]byte)

UnfoldPublicKeysIntoBytes restore public keys from sequence.

func VerifySignature

func VerifySignature(foldedPublicKeys, signature, message, caseIdentifier []byte) int

VerifySignature verifies signature.

func WriteOutput

func WriteOutput(output string, content []byte)

WriteOutput writes content to the output.

Types

type HashIdentKey

type HashIdentKey struct {
	// contains filtered or unexported fields
}

HashIdentKey contains the salted hash of public key file and IdentKey.

type IdentKey

type IdentKey struct {
	// contains filtered or unexported fields
}

IdentKey holds filename, digest (hash) of file, instance of public key.

Jump to

Keyboard shortcuts

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