Documentation ¶
Index ¶
- Constants
- func CreateCompressedVerificationMethod(id string, keyIndex int, pubKey *ecdsa.PublicKey) (*types.DidVerificationMethod, error)
- func CreateTestDidDocument(options DidDocumentTestOptions) (types.DidDocument, *ecdsa.PrivateKey, *ecdsa.PrivateKey)
- func CreateVerificationMethod(id string, keyIndex int, pubKey *ecdsa.PublicKey) (*types.DidVerificationMethod, error)
- func GenerateCompressedTestingVerificationMethod(id string, idx int) (*ecdsa.PrivateKey, *types.DidVerificationMethod, error)
- func GenerateDid() (string, *ecdsa.PrivateKey, *types.DidVerificationMethod)
- func GenerateDidFromKeyPair(publicKey *ecdsa.PublicKey) (string, *types.DidVerificationMethod)
- func GenerateGenesisState(simState *module.SimulationState)
- func GenerateRandomDIDDocument() *types.DidDocument
- func GenerateTestKeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey)
- func GenerateTestingVerificationMethod(id string, idx int) (*ecdsa.PrivateKey, *types.DidVerificationMethod, error)
- func PublicKeyToEthAddress(pubKey *ecdsa.PublicKey) string
- func SetupMsgServer(t testing.TB) (keeper.Keeper, types.MsgServer, sdk.Context)
- func SignMessage(cdc *codec.ProtoCodec, privKey *ecdsa.PrivateKey, methodId string, ...) types.Signature
- func TestMsgServer(t *testing.T)
- type DidDocumentTestOptions
Constants ¶
View Source
const SecondsInYear = int32(3600 * 24 * 365)
Variables ¶
This section is empty.
Functions ¶
func CreateCompressedVerificationMethod ¶
func CreateCompressedVerificationMethod(id string, keyIndex int, pubKey *ecdsa.PublicKey) (*types.DidVerificationMethod, error)
CreateCompressedVerificationMethod converts an ECDSA public key to a JsonWebKey structure using compressed format.
func CreateTestDidDocument ¶
func CreateTestDidDocument(options DidDocumentTestOptions) ( types.DidDocument, *ecdsa.PrivateKey, *ecdsa.PrivateKey, )
CreateTestDidDocument creates a DID document for testing, applying any specified overrides.
func CreateVerificationMethod ¶
func CreateVerificationMethod(id string, keyIndex int, pubKey *ecdsa.PublicKey) (*types.DidVerificationMethod, error)
CreateVerificationMethod converts an ECDSA public key to a JsonWebKey structure.
func GenerateCompressedTestingVerificationMethod ¶
func GenerateCompressedTestingVerificationMethod(id string, idx int) (*ecdsa.PrivateKey, *types.DidVerificationMethod, error)
func GenerateDid ¶
func GenerateDid() (string, *ecdsa.PrivateKey, *types.DidVerificationMethod)
func GenerateDidFromKeyPair ¶
func GenerateDidFromKeyPair(publicKey *ecdsa.PublicKey) (string, *types.DidVerificationMethod)
func GenerateGenesisState ¶
func GenerateGenesisState(simState *module.SimulationState)
GenerateGenesisState creates a randomized GenState of the module
func GenerateRandomDIDDocument ¶
func GenerateRandomDIDDocument() *types.DidDocument
GenerateRandomDIDDocument generates a random DIDDocument for simulation.
func GenerateTestKeyPair ¶
func GenerateTestKeyPair() (*ecdsa.PrivateKey, *ecdsa.PublicKey)
func GenerateTestingVerificationMethod ¶
func GenerateTestingVerificationMethod(id string, idx int) (*ecdsa.PrivateKey, *types.DidVerificationMethod, error)
func PublicKeyToEthAddress ¶
func SetupMsgServer ¶
func SignMessage ¶
func SignMessage( cdc *codec.ProtoCodec, privKey *ecdsa.PrivateKey, methodId string, msg codec.ProtoMarshaler, ) types.Signature
func TestMsgServer ¶
Types ¶
type DidDocumentTestOptions ¶
type DidDocumentTestOptions struct { Id string ContextOverride []string ControllerOverride []string AlsoKnownAsOverride []string VerificationMethodOverride []*types.DidVerificationMethod AuthenticationOverride []*types.DidVerificationRelationship AssertionMethodOverride []*types.DidVerificationRelationship KeyAgreementOverride []*types.DidVerificationRelationship CapabilityInvocationOverride []*types.DidVerificationRelationship CapabilityDelegationOverride []*types.DidVerificationRelationship ServiceOverride []*types.DidDocumentService }
DidDocumentTestOptions defines options for customizing the creation of DID documents in tests.
Click to show internal directories.
Click to hide internal directories.