Skip to content

Instantly share code, notes, and snippets.

@e1024kb
Last active December 15, 2015 17:20
Show Gist options
  • Save e1024kb/d06a8e9646f30a6713f6 to your computer and use it in GitHub Desktop.
Save e1024kb/d06a8e9646f30a6713f6 to your computer and use it in GitHub Desktop.
public interface ICardsClient
{
Task<VirgilCardDTO> Create(
string identityValue,
IdentityType identityType,
IDictionary<string, string> customData,
byte[] publicKey,
byte[] privateKey
);
Task<VirgilCardDTO> Create(
string identityValue,
IdentityType identityType,
IDictionary<string, string> customData,
Guid publicKey,
byte[] privateKey
);
Task<VirgilSignDTO> Sign(
Guid signedCardId,
string signedCardHash,
Guid signerCardId,
byte[] signerPrivateKey
);
Task Unsign(
Guid signedCardId,
Guid signerCardId,
byte[] privateKey
);
Task<IList<VirgilCardDTO>> Search(
string value,
VirgilIdentityType? type,
List<Guid> relations,
bool? includeUnconfirmed,
Guid signerVirgilCardId,
byte[] privateKey
);
}
public enum IdentityType
{
Email,
Application
}
public class KeysClient
{
public KeysClient(string accessToken)
{
throw new NotImplementedException();
}
public ICardsClient Cards { get; }
public IPublicKeysClient PublicKeys { get; }
}
public interface IPublicKeysClient
{
Task<PublicKeyDto> Get(Guid publicKeyId);
Task<GetPublicKeyExtendedResponse> GetExtended(
Guid publicKeyId,
Guid virgilCardId,
byte[] privateKey
);
}
var keysClient = new KeysClient("{ACCESS_TOKEN}");
keysClient.Cards.Create(...);
keysClient.Cards.Sign(...);
keysClient.Cards.Unsign(...);
keysClient.Cards.Search(...);
keysClient.PublicKeys.Get(...);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment