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;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
|
||||||
|
using System.Threading;
|
||||||
using System.Threading.Tasks;
|
using System.Threading.Tasks;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
|
||||||
using Mono.Unix;
|
|
||||||
|
|
||||||
using LetsEncrypt.Services;
|
using LetsEncrypt.Services;
|
||||||
using LetsEncrypt.Helpers;
|
using LetsEncrypt.Helpers;
|
||||||
@ -32,7 +35,7 @@ namespace LetsEncrypt
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void Run() {
|
public void Run() {
|
||||||
_appSettings.environments.Where(env => env.active).ToList().ForEach(env => {
|
foreach(var env in _appSettings.environments.Where(env => env.active)) {
|
||||||
try {
|
try {
|
||||||
Console.WriteLine(string.Format("Let's Encrypt C# .Net Core Client, environment: {0}", env.name));
|
Console.WriteLine(string.Format("Let's Encrypt C# .Net Core Client, environment: {0}", env.name));
|
||||||
|
|
||||||
@ -189,10 +192,9 @@ namespace LetsEncrypt
|
|||||||
}
|
}
|
||||||
catch (Exception ex) {
|
catch (Exception ex) {
|
||||||
Console.WriteLine(ex.Message.ToString());
|
Console.WriteLine(ex.Message.ToString());
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
// https://tools.ietf.org/html/rfc7517
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
|
|||||||
@ -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.Security.Cryptography;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
@ -31,8 +36,7 @@ namespace LetsEncrypt.Services
|
|||||||
|
|
||||||
var publicParameters = rsa.ExportParameters(false);
|
var publicParameters = rsa.ExportParameters(false);
|
||||||
|
|
||||||
_jwk = new Jwk
|
_jwk = new Jwk () {
|
||||||
{
|
|
||||||
KeyType = "RSA",
|
KeyType = "RSA",
|
||||||
Exponent = Base64UrlEncoded(publicParameters.Exponent),
|
Exponent = Base64UrlEncoded(publicParameters.Exponent),
|
||||||
Modulus = Base64UrlEncoded(publicParameters.Modulus),
|
Modulus = Base64UrlEncoded(publicParameters.Modulus),
|
||||||
@ -112,6 +116,7 @@ namespace LetsEncrypt.Services
|
|||||||
return Base64UrlEncoded(Encoding.UTF8.GetBytes(s));
|
return Base64UrlEncoded(Encoding.UTF8.GetBytes(s));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://tools.ietf.org/html/rfc4648#section-5
|
||||||
public string Base64UrlEncoded(byte[] arg)
|
public string Base64UrlEncoded(byte[] arg)
|
||||||
{
|
{
|
||||||
var s = Convert.ToBase64String(arg); // Regular base64 encoder
|
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://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
|
* https://tools.ietf.org/html/rfc8555#section-6.2
|
||||||
*
|
*
|
||||||
@ -100,7 +99,6 @@ namespace LetsEncrypt.Services {
|
|||||||
// 1 - Get directory
|
// 1 - Get directory
|
||||||
(_directory, _) = await SendAsync<AcmeDirectory>(HttpMethod.Get, new Uri("directory", UriKind.Relative), null, token);
|
(_directory, _) = await SendAsync<AcmeDirectory>(HttpMethod.Get, new Uri("directory", UriKind.Relative), null, token);
|
||||||
|
|
||||||
|
|
||||||
if (File.Exists(_path))
|
if (File.Exists(_path))
|
||||||
{
|
{
|
||||||
bool success;
|
bool success;
|
||||||
@ -420,8 +418,7 @@ namespace LetsEncrypt.Services {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <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>
|
/// </summary>
|
||||||
/// <param name="token"></param>
|
/// <param name="token"></param>
|
||||||
/// <returns></returns>
|
/// <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