mirror of
https://github.com/MAKS-IT-COM/maksit-certs-ui.git
synced 2025-12-31 04:00:03 +01:00
minor fixes and logic improvements
This commit is contained in:
parent
9b4d28ec64
commit
95305cfeb4
@ -1,13 +1,16 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Collections.Generic;
|
||||
|
||||
using System.Linq;
|
||||
|
||||
|
||||
using Microsoft.Extensions.Options;
|
||||
|
||||
using Mono.Unix;
|
||||
|
||||
|
||||
using LetsEncrypt.Services;
|
||||
using LetsEncrypt.Helpers;
|
||||
@ -32,7 +35,7 @@ namespace LetsEncrypt
|
||||
}
|
||||
|
||||
public void Run() {
|
||||
_appSettings.environments.Where(env => env.active).ToList().ForEach(env => {
|
||||
foreach(var env in _appSettings.environments.Where(env => env.active)) {
|
||||
try {
|
||||
Console.WriteLine(string.Format("Let's Encrypt C# .Net Core Client, environment: {0}", env.name));
|
||||
|
||||
@ -189,10 +192,9 @@ namespace LetsEncrypt
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Console.WriteLine(ex.Message.ToString());
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,10 +1,12 @@
|
||||
// https://tools.ietf.org/html/rfc7517
|
||||
|
||||
using System;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
|
||||
namespace LetsEncrypt.Entities
|
||||
{
|
||||
public class Jwk
|
||||
public class Jwk
|
||||
{
|
||||
/// <summary>
|
||||
/// "kty" (Key Type) Parameter
|
||||
|
||||
@ -1,4 +1,9 @@
|
||||
using System;
|
||||
/**
|
||||
* https://tools.ietf.org/html/rfc4648
|
||||
* https://tools.ietf.org/html/rfc4648#section-5
|
||||
*/
|
||||
|
||||
using System;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using Newtonsoft.Json;
|
||||
@ -31,8 +36,7 @@ namespace LetsEncrypt.Services
|
||||
|
||||
var publicParameters = rsa.ExportParameters(false);
|
||||
|
||||
_jwk = new Jwk
|
||||
{
|
||||
_jwk = new Jwk () {
|
||||
KeyType = "RSA",
|
||||
Exponent = Base64UrlEncoded(publicParameters.Exponent),
|
||||
Modulus = Base64UrlEncoded(publicParameters.Modulus),
|
||||
@ -112,6 +116,7 @@ namespace LetsEncrypt.Services
|
||||
return Base64UrlEncoded(Encoding.UTF8.GetBytes(s));
|
||||
}
|
||||
|
||||
// https://tools.ietf.org/html/rfc4648#section-5
|
||||
public string Base64UrlEncoded(byte[] arg)
|
||||
{
|
||||
var s = Convert.ToBase64String(arg); // Regular base64 encoder
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
/**
|
||||
* tools.itef.org/html/draft-itef-acme-acme-18
|
||||
* https://community.letsencrypt.org/t/trying-to-do-post-as-get-but-getting-post-jws-not-signed/108371
|
||||
* https://tools.ietf.org/html/rfc8555#section-6.2
|
||||
*
|
||||
@ -100,7 +99,6 @@ namespace LetsEncrypt.Services {
|
||||
// 1 - Get directory
|
||||
(_directory, _) = await SendAsync<AcmeDirectory>(HttpMethod.Get, new Uri("directory", UriKind.Relative), null, token);
|
||||
|
||||
|
||||
if (File.Exists(_path))
|
||||
{
|
||||
bool success;
|
||||
@ -420,8 +418,7 @@ namespace LetsEncrypt.Services {
|
||||
/// </summary>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
public async Task KeyChange(CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
public async Task KeyChange(CancellationToken token = default(CancellationToken)) {
|
||||
|
||||
}
|
||||
|
||||
@ -431,8 +428,7 @@ namespace LetsEncrypt.Services {
|
||||
/// </summary>
|
||||
/// <param name="token"></param>
|
||||
/// <returns></returns>
|
||||
public async Task RevokeCertificate(CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
public async Task RevokeCertificate(CancellationToken token = default(CancellationToken)) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user