ecdsa

package
v0.5.13 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2026 License: BSD-2-Clause Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Cryptosuite2019 = "ecdsa-rdfc-2019"
	ProofType       = credential.ProofTypeDataIntegrity
)
View Source
const (
	CryptosuiteSd2023 = "ecdsa-sd-2023"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseProofValue

type BaseProofValue struct {
	BaseSignature     []byte   `cbor:"0,keyasint"`
	PublicKey         []byte   `cbor:"1,keyasint"`
	HmacKey           []byte   `cbor:"2,keyasint"`
	Signatures        [][]byte `cbor:"3,keyasint"`
	MandatoryPointers []string `cbor:"4,keyasint"`
}

BaseProofValue represents the decoded proof value for a base proof Encoded as a CBOR array

type BaseProofValueArray

type BaseProofValueArray struct {
	BaseSignature     []byte
	PublicKey         []byte
	HmacKey           []byte
	Signatures        [][]byte
	MandatoryPointers []string
	// contains filtered or unexported fields
}

BaseProofValueArray is used for CBOR serialization as an array

type DerivedProofValue

type DerivedProofValue struct {
	BaseSignature    []byte            `cbor:"0,keyasint"`
	PublicKey        []byte            `cbor:"1,keyasint"`
	Signatures       [][]byte          `cbor:"2,keyasint"`
	LabelMap         map[string]string `cbor:"3,keyasint"`
	MandatoryIndexes []int             `cbor:"4,keyasint"`
}

DerivedProofValue represents the decoded proof value for a derived proof Encoded as a CBOR array

type DerivedProofValueArray

type DerivedProofValueArray struct {
	BaseSignature    []byte
	PublicKey        []byte
	Signatures       [][]byte
	LabelMap         map[string]string
	MandatoryIndexes []int
	// contains filtered or unexported fields
}

DerivedProofValueArray is used for CBOR serialization as an array

type SdSignOptions

type SdSignOptions struct {
	VerificationMethod string
	ProofPurpose       string
	Created            time.Time
	Domain             string
	Challenge          string
	MandatoryPointers  []string // JSON pointers to mandatory fields
}

SdSignOptions contains options for signing with selective disclosure

type SdSuite

type SdSuite struct{}

SdSuite implements the ECDSA Selective Disclosure Cryptosuite v1.0

func NewSdSuite

func NewSdSuite() *SdSuite

NewSdSuite creates a new ECDSA SD cryptosuite

func (*SdSuite) Derive

func (s *SdSuite) Derive(cred *credential.RDFCredential, revealIndices []int, nonce string) (*credential.RDFCredential, error)

Derive creates a Derived Proof from a Base Proof

func (*SdSuite) Sign

Sign creates a Base Proof for the credential

func (*SdSuite) Verify

func (s *SdSuite) Verify(cred *credential.RDFCredential, key *ecdsa.PublicKey) error

Verify verifies a credential using ecdsa-sd-2023

type SignOptions

type SignOptions struct {
	VerificationMethod string
	ProofPurpose       string
	Created            time.Time
	Domain             string
	Challenge          string
}

SignOptions contains options for signing

type Suite

type Suite struct{}

Suite implements the ECDSA Cryptosuite v1.0

func NewSuite

func NewSuite() *Suite

NewSuite creates a new ECDSA cryptosuite

func (*Suite) Sign

Sign signs a credential using ecdsa-rdfc-2019

func (*Suite) SignWithSigner

func (s *Suite) SignWithSigner(ctx context.Context, cred *credential.RDFCredential, signer vccrypto.VCSigner, opts *SignOptions) (*credential.RDFCredential, error)

SignWithSigner signs a credential using ecdsa-rdfc-2019 with a VCSigner. This method supports both raw keys (via wrappers) and HSM-backed keys (via pki.RawSigner).

func (*Suite) Verify

func (s *Suite) Verify(cred *credential.RDFCredential, key *ecdsa.PublicKey) error

Verify verifies a credential using ecdsa-rdfc-2019

Jump to

Keyboard shortcuts

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