Credify.SDK
1.0.5
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package Credify.SDK --version 1.0.5
NuGet\Install-Package Credify.SDK -Version 1.0.5
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Credify.SDK" Version="1.0.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Credify.SDK" Version="1.0.5" />
<PackageReference Include="Credify.SDK" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Credify.SDK --version 1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: Credify.SDK, 1.0.5"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Credify.SDK@1.0.5
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Credify.SDK&version=1.0.5
#tool nuget:?package=Credify.SDK&version=1.0.5
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
Credify .Net SDK
How to use
Initialization
var signingPrivateKey = "";
var apiKey = "";
var env = Environment.Development;
var config = new SdkConfig(signingPrivateKey,apiKey,env);
var sdk = new CredifySdk(config);
Create a new account
This function generates a new user with a provided profile and password on the Credify system. The output is a new user's ID.
var profile = new Profile
{
Name = new Name
{
FirstName = "Stephen",
LastName = "Nguyen",
},
Phones = new List<Phone>
{
new()
{
PhoneNumber = "906987654",
CountryCode = "+84"
}
},
Emails = new List<Email>
{
new()
{
EmailAddress = "thisIsEmail@gmail.com"
}
},
};
var keys = new Keys
{
EncryptionPublicKey = "",
EncryptionSecret = "",
SigningPublicKey = "",
SigningSecret = ""
};
var password = "Xbkqhrqqhe331@";
var id = _sdk.EntityService.CreateEntity(profile, password, keys);
Console.WriteLine("entity created with id: " + id);
Push a custom claim
This records claim tokens into a blockchain. The claim tokens will be generated out of provided claim values.
var claims = new Claims();
claims.Add("this is scope-name",
new Dictionary<string, object> {{"this is claim-name", "claim-value"}});
var result = _sdk.ClaimService.Push("provider id (oragnization id)",
"entity id", claims);
foreach (var commitment in result)
{
Console.WriteLine($"Scope name: {commitment.Key}");
Console.WriteLine($"Commitments: {commitment.Value}");
}
Encrypt claims
This encrypts claim values with a passed encryption public key.
var claims = new Claims();
claims.Add("this is scope-name",
new Dictionary<string, object> {{"this is claim-name", "claim-value"}});
var encrytionPublicKey = "";
var encryptedClaims = _sdk.ClaimService.Encrypt(claims, encrytionPublicKey);
Kicks off OIDC
This generates an ephemeral encryption key to secure an OIDC flow.
var consumerId = "8f530df6-98aa-4849-bcaf-d62705435266";
var callbackUrl = "https://callback.url";
var initiateOidcRes = sdk.OidcService.InitiateOidc(consumerId, callbackUrl,
new List<string> {"openid", "phone", "email", "profile"},
new OidcOptions {ResponseType = "code"});
Get UserInfo
This retrieved and decrypt claim value
var userInfo = sdk.OidcService.UserInfo("accessToken", "this is your private key");
Introspect token
This validate the token is valid for the scope
var token = "eyJhbGciOiJSUzI1NiIsImtpZCI6InB1YmxpYzo4ZD...WNQfpKKGKuw";
var scope = "individual:read_evaluated_offer";
var isActive = _sdk.OidcService.IntrospectToken(token, scope);
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- Credify.Crypto (>= 1.0.3)
- Microsoft.AspNet.WebApi.Client (>= 5.2.7)
- Newtonsoft.Json (>= 12.0.3)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.1.8 | 650 | 1/13/2022 |
| 1.1.7 | 544 | 1/12/2022 |
| 1.1.6 | 506 | 10/28/2021 |
| 1.1.5 | 456 | 10/12/2021 |
| 1.1.4 | 513 | 9/16/2021 |
| 1.1.3 | 493 | 8/24/2021 |
| 1.1.2 | 492 | 7/23/2021 |
| 1.1.1 | 429 | 7/23/2021 |
| 1.1.0 | 496 | 7/23/2021 |
| 1.0.7 | 508 | 4/26/2021 |
| 1.0.6 | 473 | 4/13/2021 |
| 1.0.5 | 504 | 4/5/2021 |
| 1.0.4 | 507 | 3/29/2021 |
| 1.0.3 | 527 | 3/26/2021 |
| 1.0.2 | 527 | 3/12/2021 |