Skip to content

@gala-chain/testAPI


API > x509Identity

Function: x509Identity()

x509Identity(caUser, mspId): ClientIdentity

Creates a mock X.509 client identity for testing purposes.

Parameters

caUser: string

User identifier, typically in format "client|username"

mspId: string

Membership Service Provider ID

Returns

Mock ClientIdentity with X.509 certificate information

Example

const identity = x509Identity("client|alice", "CuratorOrg");
console.log(identity.getID()); // x509::/OU=client/CN=alice::...

Source

chain-test/src/unit/TestChaincodeStub.ts:74