-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConfigSettings.cs
More file actions
44 lines (37 loc) · 1.17 KB
/
ConfigSettings.cs
File metadata and controls
44 lines (37 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using System.IO;
using Newtonsoft.Json;
namespace rajapet.isuserinapple
{
/// <summary>
/// C# Wrapper for the configuration settings file
/// </summary>
public class ConfigSettings
{
/// <summary>
/// Path the private key file in PEMS format
/// </summary>
public string PrivateKeyFile {get; set;}
/// <summary>
/// Your private key ID from App Store Connect
/// </summary>
public string KeyID {get; set;}
/// <summary>
/// Your issuer ID from the API Keys page in App Store Connect
/// </summary>
public string IssuerID {get; set;}
public ConfigSettings() {}
public ConfigSettings(string fileName) : base()
{
_ = LoadFromFile(fileName);
}
public ConfigSettings LoadFromFile(string fileName)
{
var c = JsonConvert.DeserializeObject<ConfigSettings>(File.ReadAllText(fileName));
this.PrivateKeyFile = c.PrivateKeyFile;
this.KeyID = c.KeyID;
this.IssuerID = c.IssuerID;
return this;
}
}
}