crypto: align file name with the VerificationMethod name

This commit is contained in:
Michael Muré
2025-07-10 15:44:31 +02:00
parent f879d6a14a
commit fbe9591a21
6 changed files with 7 additions and 7 deletions

View File

@@ -12,7 +12,7 @@ import (
_ "github.com/INFURA/go-did/methods/did-key"
)
func ExampleSignature() {
func Example_signature() {
// errors need to be handled
// 1) Parse the DID string into a DID object
@@ -32,7 +32,7 @@ func ExampleSignature() {
// Output: Signature is valid, verified with method: Ed25519VerificationKey2020 did:key:z6MknwcywUtTy2ADJQ8FH1GcSySKPyKDmyzT4rPEE84XREse#z6MknwcywUtTy2ADJQ8FH1GcSySKPyKDmyzT4rPEE84XREse
}
func ExampleKeyAgreement() {
func Example_keyAgreement() {
// errors need to be handled
// 1) We have a private key for Alice

View File

@@ -122,7 +122,7 @@ func (d DidKey) Document(opts ...did.ResolutionOption) (did.Document, error) {
jwk := jsonwebkey.NewJsonWebKey2020(mainVmId, pub, d)
doc.signature = jwk
doc.keyAgreement = jwk
case params.HasVerificationMethodHint(secp256k1vm.Type):
case params.HasVerificationMethodHint(secp256k1vm.Type2019):
vm := secp256k1vm.NewVerificationKey2019(mainVmId, pub, d)
doc.signature = vm
doc.keyAgreement = vm

View File

@@ -183,7 +183,7 @@ func LoadTestVectors(filename string) ([]Vector, error) {
}
switch vmType {
case secp256k1vm.Type:
case secp256k1vm.Type2019:
vect.Pub, err = secp256k1.PublicKeyFromBytes(pubBytes)
if err != nil {
return nil, err

View File

@@ -31,7 +31,7 @@ func UnmarshalJSON(data []byte) (did.VerificationMethod, error) {
res = &multikey.MultiKey{}
case p256vm.Type2021:
res = &p256vm.Key2021{}
case secp256k1vm.Type:
case secp256k1vm.Type2019:
res = &secp256k1vm.VerificationKey2019{}
case x25519vm.Type2019:
res = &x25519vm.KeyAgreementKey2019{}

View File

@@ -16,7 +16,7 @@ import (
const (
JsonLdContext = "https://w3id.org/security/suites/secp256k1-2019/v1"
Type = "EcdsaSecp256k1VerificationKey2019"
Type2019 = "EcdsaSecp256k1VerificationKey2019"
)
var _ did.VerificationMethodSignature = &VerificationKey2019{}
@@ -90,7 +90,7 @@ func (vm VerificationKey2019) ID() string {
}
func (vm VerificationKey2019) Type() string {
return Type
return Type2019
}
func (vm VerificationKey2019) Controller() string {