From 3e08f9093cda228429571f5bca43c757806e2be5 Mon Sep 17 00:00:00 2001 From: maks-it Date: Sat, 29 Jun 2019 18:38:18 +0200 Subject: [PATCH] using corrections --- LetsEncrypt/ACMEv2/Account.cs | 10 ------- LetsEncrypt/ACMEv2/AuthorizationChallange.cs | 10 ------- .../ACMEv2/AuthorizationChallengeResponse.cs | 10 ------- LetsEncrypt/ACMEv2/AuthorizeChallenge.cs | 13 +--------- LetsEncrypt/ACMEv2/CachedCertificateResult.cs | 13 +--------- LetsEncrypt/ACMEv2/CertificateCache.cs | 15 +---------- LetsEncrypt/ACMEv2/DirectoryMeta.cs | 13 +--------- LetsEncrypt/ACMEv2/FinalizeRequest.cs | 13 +--------- LetsEncrypt/ACMEv2/IHashLocation.cs | 12 +-------- LetsEncrypt/ACMEv2/Jwk.cs | 26 +++++++++++++++---- LetsEncrypt/ACMEv2/JwsHeader.cs | 10 ------- LetsEncrypt/ACMEv2/JwsMessage.cs | 13 +--------- LetsEncrypt/ACMEv2/LetsEncrytException.cs | 10 ------- LetsEncrypt/ACMEv2/Order.cs | 10 ------- LetsEncrypt/ACMEv2/OrderIdentifier.cs | 14 ++-------- LetsEncrypt/ACMEv2/Problem.cs | 13 +--------- LetsEncrypt/ACMEv2/RegistrationCache.cs | 10 ------- LetsEncrypt/Program.cs | 9 +++---- 18 files changed, 34 insertions(+), 190 deletions(-) diff --git a/LetsEncrypt/ACMEv2/Account.cs b/LetsEncrypt/ACMEv2/Account.cs index dc9fe45..091947c 100644 --- a/LetsEncrypt/ACMEv2/Account.cs +++ b/LetsEncrypt/ACMEv2/Account.cs @@ -3,17 +3,7 @@ */ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/AuthorizationChallange.cs b/LetsEncrypt/ACMEv2/AuthorizationChallange.cs index a1eac08..618d52a 100644 --- a/LetsEncrypt/ACMEv2/AuthorizationChallange.cs +++ b/LetsEncrypt/ACMEv2/AuthorizationChallange.cs @@ -1,15 +1,5 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/AuthorizationChallengeResponse.cs b/LetsEncrypt/ACMEv2/AuthorizationChallengeResponse.cs index 43f9726..9345e0e 100644 --- a/LetsEncrypt/ACMEv2/AuthorizationChallengeResponse.cs +++ b/LetsEncrypt/ACMEv2/AuthorizationChallengeResponse.cs @@ -1,15 +1,5 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/AuthorizeChallenge.cs b/LetsEncrypt/ACMEv2/AuthorizeChallenge.cs index 54525e0..e81a133 100644 --- a/LetsEncrypt/ACMEv2/AuthorizeChallenge.cs +++ b/LetsEncrypt/ACMEv2/AuthorizeChallenge.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using Newtonsoft.Json; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/CachedCertificateResult.cs b/LetsEncrypt/ACMEv2/CachedCertificateResult.cs index 9895663..0bb886c 100644 --- a/LetsEncrypt/ACMEv2/CachedCertificateResult.cs +++ b/LetsEncrypt/ACMEv2/CachedCertificateResult.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using System.Security.Cryptography; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/CertificateCache.cs b/LetsEncrypt/ACMEv2/CertificateCache.cs index ebadc42..77df951 100644 --- a/LetsEncrypt/ACMEv2/CertificateCache.cs +++ b/LetsEncrypt/ACMEv2/CertificateCache.cs @@ -1,17 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -namespace ACMEv2 +namespace ACMEv2 { public class CertificateCache { diff --git a/LetsEncrypt/ACMEv2/DirectoryMeta.cs b/LetsEncrypt/ACMEv2/DirectoryMeta.cs index 0260dd7..cf9c308 100644 --- a/LetsEncrypt/ACMEv2/DirectoryMeta.cs +++ b/LetsEncrypt/ACMEv2/DirectoryMeta.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using Newtonsoft.Json; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/FinalizeRequest.cs b/LetsEncrypt/ACMEv2/FinalizeRequest.cs index 4cc0f80..e9175b1 100644 --- a/LetsEncrypt/ACMEv2/FinalizeRequest.cs +++ b/LetsEncrypt/ACMEv2/FinalizeRequest.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using Newtonsoft.Json; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/IHashLocation.cs b/LetsEncrypt/ACMEv2/IHashLocation.cs index a7fee22..8927a70 100644 --- a/LetsEncrypt/ACMEv2/IHashLocation.cs +++ b/LetsEncrypt/ACMEv2/IHashLocation.cs @@ -1,15 +1,5 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; + namespace ACMEv2 { interface IHasLocation diff --git a/LetsEncrypt/ACMEv2/Jwk.cs b/LetsEncrypt/ACMEv2/Jwk.cs index f618059..0453ae7 100644 --- a/LetsEncrypt/ACMEv2/Jwk.cs +++ b/LetsEncrypt/ACMEv2/Jwk.cs @@ -2,6 +2,7 @@ * JSON Web Key (JWK) * https://tools.ietf.org/html/rfc7517 * https://www.gnupg.org/documentation/manuals/gcrypt-devel/RSA-key-parameters.html + * https://static.javadoc.io/com.nimbusds/nimbus-jose-jwt/2.15.2/com/nimbusds/jose/jwk/RSAKey.html * */ @@ -46,44 +47,59 @@ namespace ACMEv2 public string Use { get; set; } /// - /// RSA public modulus n. + /// The the modulus value for the public RSA key. It is represented as the Base64URL encoding of value's big endian representation. /// [JsonProperty("n")] public string Modulus { get; set; } /// - /// RSA public exponent e. + /// The exponent value for the public RSA key. It is represented as the Base64URL encoding of value's big endian representation. /// [JsonProperty("e")] public string Exponent { get; set; } /// - /// RSA secret exponent d = e^-1 \bmod (p-1)(q-1). + /// The private exponent. It is represented as the Base64URL encoding of the value's big endian representation. /// [JsonProperty("d")] public string D { get; set; } /// - /// RSA secret prime p. + /// The first prime factor. It is represented as the Base64URL encoding of the value's big endian representation. /// [JsonProperty("p")] public string P { get; set; } /// - /// RSA secret prime q with p < q. + /// The second prime factor. It is represented as the Base64URL encoding of the value's big endian representation. /// [JsonProperty("q")] public string Q { get; set; } + /// + /// The first factor Chinese Remainder Theorem exponent. It is represented as the Base64URL encoding of the value's big endian representation. + /// [JsonProperty("dp")] public string DP { get; set; } + /// + /// The second factor Chinese Remainder Theorem exponent. It is represented as the Base64URL encoding of the value's big endian representation. + /// [JsonProperty("dq")] public string DQ { get; set; } + /// + /// The first Chinese Remainder Theorem coefficient. It is represented as the Base64URL encoding of the value's big endian representation. + /// [JsonProperty("qi")] public string InverseQ { get; set; } + /// + /// The other primes information, should they exist, null or an empty list if not specified. + /// + [JsonProperty("oth")] + public string OthInf { get; set; } + /// /// "alg" (Algorithm) Parameter /// diff --git a/LetsEncrypt/ACMEv2/JwsHeader.cs b/LetsEncrypt/ACMEv2/JwsHeader.cs index bfbd52e..3429e0a 100644 --- a/LetsEncrypt/ACMEv2/JwsHeader.cs +++ b/LetsEncrypt/ACMEv2/JwsHeader.cs @@ -1,15 +1,5 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/JwsMessage.cs b/LetsEncrypt/ACMEv2/JwsMessage.cs index 0b854c6..5eae70b 100644 --- a/LetsEncrypt/ACMEv2/JwsMessage.cs +++ b/LetsEncrypt/ACMEv2/JwsMessage.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using Newtonsoft.Json; namespace ACMEv2 diff --git a/LetsEncrypt/ACMEv2/LetsEncrytException.cs b/LetsEncrypt/ACMEv2/LetsEncrytException.cs index 30e7bfa..ed8c440 100644 --- a/LetsEncrypt/ACMEv2/LetsEncrytException.cs +++ b/LetsEncrypt/ACMEv2/LetsEncrytException.cs @@ -1,15 +1,5 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/Order.cs b/LetsEncrypt/ACMEv2/Order.cs index 602b20e..41e6070 100644 --- a/LetsEncrypt/ACMEv2/Order.cs +++ b/LetsEncrypt/ACMEv2/Order.cs @@ -1,15 +1,5 @@ using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace ACMEv2 diff --git a/LetsEncrypt/ACMEv2/OrderIdentifier.cs b/LetsEncrypt/ACMEv2/OrderIdentifier.cs index 4f4e037..b0015fd 100644 --- a/LetsEncrypt/ACMEv2/OrderIdentifier.cs +++ b/LetsEncrypt/ACMEv2/OrderIdentifier.cs @@ -1,15 +1,5 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using Newtonsoft.Json; + namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/Problem.cs b/LetsEncrypt/ACMEv2/Problem.cs index cb3a64b..512d2b7 100644 --- a/LetsEncrypt/ACMEv2/Problem.cs +++ b/LetsEncrypt/ACMEv2/Problem.cs @@ -1,15 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; +using Newtonsoft.Json; namespace ACMEv2 { diff --git a/LetsEncrypt/ACMEv2/RegistrationCache.cs b/LetsEncrypt/ACMEv2/RegistrationCache.cs index cb5789e..4057ad8 100644 --- a/LetsEncrypt/ACMEv2/RegistrationCache.cs +++ b/LetsEncrypt/ACMEv2/RegistrationCache.cs @@ -1,15 +1,5 @@ using System; using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Net.Http; -using System.Security.Cryptography; -using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; namespace ACMEv2 { diff --git a/LetsEncrypt/Program.cs b/LetsEncrypt/Program.cs index 988a165..1592aea 100644 --- a/LetsEncrypt/Program.cs +++ b/LetsEncrypt/Program.cs @@ -1,15 +1,12 @@ using System; using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Net.Http; + using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; -using System.Text; -using System.Threading; + using System.Threading.Tasks; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; + using ACMEv2;