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.
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.
// Install Credify.SDK as a Cake Addin #addin nuget:?package=Credify.SDK&version=1.0.5 // Install Credify.SDK as a Cake Tool #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. |
.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 | 494 | 1/13/2022 |
1.1.7 | 420 | 1/12/2022 |
1.1.6 | 383 | 10/28/2021 |
1.1.5 | 335 | 10/12/2021 |
1.1.4 | 382 | 9/16/2021 |
1.1.3 | 357 | 8/24/2021 |
1.1.2 | 369 | 7/23/2021 |
1.1.1 | 300 | 7/23/2021 |
1.1.0 | 379 | 7/23/2021 |
1.0.7 | 368 | 4/26/2021 |
1.0.6 | 350 | 4/13/2021 |
1.0.5 | 371 | 4/5/2021 |
1.0.4 | 378 | 3/29/2021 |
1.0.3 | 388 | 3/26/2021 |
1.0.2 | 406 | 3/12/2021 |