Documentation ¶
Index ¶
- Constants
- func NewSignerInitializer(options *SignerInitializerOptions) suite.SignerInitializer
- func NewVerifierInitializer(options *VerifierInitializerOptions) suite.VerifierInitializer
- type KMSSigner
- type Options
- type Signer
- type SignerGetter
- type SignerInitializerOptions
- type Suite
- type SuiteInitializer
- type Verifier
- type VerifierInitializerOptions
Constants ¶
const ( // SuiteType "eddsa-rdfc-2022" is the data integrity Type identifier for the suite // implementing eddsa signatures with RDF canonicalization as per this // spec:https://w3c.github.io/vc-di-eddsa/#verify-proof-eddsa-rdfc-2022 SuiteType = "eddsa-rdfc-2022" // SuiteType2 "eddsa-2022" is the data integrity Type identifier for the suite. Alias (vc playground). SuiteType2 = "eddsa-2022" )
Variables ¶
This section is empty.
Functions ¶
func NewSignerInitializer ¶
func NewSignerInitializer(options *SignerInitializerOptions) suite.SignerInitializer
NewSignerInitializer returns a suite.SignerInitializer that initializes an eddsa-2022 signing Suite with the given SignerInitializerOptions.
func NewVerifierInitializer ¶
func NewVerifierInitializer(options *VerifierInitializerOptions) suite.VerifierInitializer
NewVerifierInitializer returns a suite.VerifierInitializer that initializes an eddsa-2022 verification Suite with the given VerifierInitializerOptions.
Types ¶
type KMSSigner ¶
type KMSSigner interface { // Sign will sign msg using a matching signature primitive in kh key handle of a private key // returns: // signature in []byte // error in case of errors Sign(msg []byte, kh interface{}) ([]byte, error) }
A KMSSigner is able to sign messages.
type Options ¶
type Options struct { LDDocumentLoader ld.DocumentLoader ED25519Verifier Verifier SignerGetter SignerGetter }
Options provides initialization options for Suite.
type Signer ¶
type Signer interface { // Sign will sign msg using a private key internal to the Signer. // returns: // signature in []byte // error in case of errors Sign(msg []byte) ([]byte, error) }
A Signer is able to sign messages.
type SignerGetter ¶
SignerGetter returns a Signer, which must sign with the private key matching the public key provided in models.ProofOptions.VerificationMethod.
func WithKMSCryptoWrapper ¶
func WithKMSCryptoWrapper(kmsCrypto wrapperapi.KMSCryptoSigner) SignerGetter
WithKMSCryptoWrapper provides a SignerGetter using the kmscrypto wrapper.
This SignerGetter assumes that the public key JWKs provided were received from the same kmscrypto.KMSCrypto implementation.
func WithStaticSigner ¶
func WithStaticSigner(signer Signer) SignerGetter
WithStaticSigner sets the Suite to use a fixed Signer, with externally-chosen signing key.
Use when a signing Suite is initialized for a single signature, then thrown away.
type SignerInitializerOptions ¶
type SignerInitializerOptions struct { LDDocumentLoader ld.DocumentLoader SignerGetter SignerGetter }
SignerInitializerOptions provides options for a SignerInitializer.
type Suite ¶
type Suite struct {
// contains filtered or unexported fields
}
Suite implements the eddsa-2022 data integrity cryptographic suite.
func (*Suite) CreateProof ¶
CreateProof implements the eddsa-2022 cryptographic suite for Add Proof.
func (*Suite) RequiresCreated ¶
RequiresCreated returns false, as the eddsa-2022 cryptographic suite does not require the use of the models.Proof.Created field.
func (*Suite) VerifyProof ¶
VerifyProof implements the eddsa-2022 cryptographic suite for CheckJWTProof Proof.
type SuiteInitializer ¶
SuiteInitializer is the initializer for Suite.
type Verifier ¶
type Verifier interface { // Verify will verify a signature for the given msg using a matching signature primitive in kh key handle of // a public key // returns: // error in case of errors or nil if signature verification was successful Verify(signature, msg []byte, pubKey *pubkey.PublicKey) error }
A Verifier is able to verify messages.
type VerifierInitializerOptions ¶
type VerifierInitializerOptions struct { LDDocumentLoader ld.DocumentLoader // required Ed25519Verifier Verifier // optional }
VerifierInitializerOptions provides options for a VerifierInitializer.