gabikeys

package
v0.0.0-...-b0046da Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: BSD-3-Clause Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const (
	XMLHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>\n"
)

Variables

This section is empty.

Functions

func WriteKeyTo

func WriteKeyTo(header []byte, body []byte, writer io.Writer) (int64, error)

writeKeyTo is a shared helper for writing XML-serialized keys.

func WriteKeyToFile

func WriteKeyToFile(filename string, forceOverwrite bool, writeFn func(io.Writer) (int64, error)) (int64, error)

WriteKeyToFile is a shared helper for writing a key to a file.

Types

type BasePrivateKey

type BasePrivateKey struct {
	XMLName    xml.Name `xml:"http://www.zurich.ibm.com/security/idemix IssuerPrivateKey"`
	Counter    uint     `xml:"Counter"`
	ExpiryDate int64    `xml:"ExpiryDate"`
}

BasePrivateKey holds the high-level fields shared by all private key implementations. Concrete key types in crypto-specific packages embed this.

func (*BasePrivateKey) GetCounter

func (sk *BasePrivateKey) GetCounter() uint

func (*BasePrivateKey) GetExpiryDate

func (sk *BasePrivateKey) GetExpiryDate() int64

func (*BasePrivateKey) ValidAt

func (sk *BasePrivateKey) ValidAt(t time.Time) bool

type BasePublicKey

type BasePublicKey struct {
	XMLName    xml.Name `xml:"http://www.zurich.ibm.com/security/idemix IssuerPublicKey"`
	Counter    uint     `xml:"Counter"`
	ExpiryDate int64    `xml:"ExpiryDate"`
	Issuer     string   `xml:"-"`
}

BasePublicKey holds the high-level fields shared by all public key implementations. Concrete key types in crypto-specific packages embed this.

func (*BasePublicKey) GetCounter

func (pk *BasePublicKey) GetCounter() uint

func (*BasePublicKey) GetExpiryDate

func (pk *BasePublicKey) GetExpiryDate() int64

func (*BasePublicKey) GetIssuer

func (pk *BasePublicKey) GetIssuer() string

func (*BasePublicKey) SetExpiryDate

func (pk *BasePublicKey) SetExpiryDate(expiryDate int64)

func (*BasePublicKey) SetIssuer

func (pk *BasePublicKey) SetIssuer(issuer string)

func (*BasePublicKey) ValidAt

func (pk *BasePublicKey) ValidAt(t time.Time) bool

type PrivateKey

type PrivateKey interface {
	GetCounter() uint
	GetExpiryDate() int64
	ValidAt(t time.Time) bool
	WriteTo(writer io.Writer) (int64, error)
	WriteToFile(filename string, forceOverwrite bool) (int64, error)
	Print() error
}

PrivateKey is the high-level, crypto-agnostic interface for an issuer private key.

type PublicKey

type PublicKey interface {
	GetCounter() uint
	GetExpiryDate() int64
	SetExpiryDate(expiryDate int64)
	GetIssuer() string
	SetIssuer(issuer string)
	ValidAt(t time.Time) bool
	WriteTo(writer io.Writer) (int64, error)
	WriteToFile(filename string, forceOverwrite bool) (int64, error)
	Print() error
}

PublicKey is the high-level, crypto-agnostic interface for an issuer public key.

Jump to

Keyboard shortcuts

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