Documentation
¶
Index ¶
- Constants
- type BaseProofValue
- type BaseProofValueArray
- type DerivedProofValue
- type DerivedProofValueArray
- type SdSignOptions
- type SdSuite
- func (s *SdSuite) Derive(cred *credential.RDFCredential, revealIndices []int, nonce string) (*credential.RDFCredential, error)
- func (s *SdSuite) Sign(cred *credential.RDFCredential, key *ecdsa.PrivateKey, opts *SdSignOptions) (*credential.RDFCredential, error)
- func (s *SdSuite) Verify(cred *credential.RDFCredential, key *ecdsa.PublicKey) error
- type SignOptions
- type Suite
- func (s *Suite) Sign(ctx context.Context, cred *credential.RDFCredential, key *ecdsa.PrivateKey, ...) (*credential.RDFCredential, error)
- func (s *Suite) SignWithSigner(ctx context.Context, cred *credential.RDFCredential, signer vccrypto.VCSigner, ...) (*credential.RDFCredential, error)
- func (s *Suite) Verify(cred *credential.RDFCredential, key *ecdsa.PublicKey) error
Constants ¶
const ( Cryptosuite2019 = "ecdsa-rdfc-2019" ProofType = credential.ProofTypeDataIntegrity )
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 (*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 ¶
func (s *SdSuite) Sign(cred *credential.RDFCredential, key *ecdsa.PrivateKey, opts *SdSignOptions) (*credential.RDFCredential, error)
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 (*Suite) Sign ¶
func (s *Suite) Sign(ctx context.Context, cred *credential.RDFCredential, key *ecdsa.PrivateKey, opts *SignOptions) (*credential.RDFCredential, error)
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