Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FIT-Connect-SDK - .NET
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
FIT-Connect
FIT-Connect-SDK - .NET
Commits
d1a91125
Commit
d1a91125
authored
2 years ago
by
Klaus Fischer
Browse files
Options
Downloads
Patches
Plain Diff
Removed comments
parent
a7fd36a0
No related branches found
No related tags found
1 merge request
!14
Feature/784 rework submission creation
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
FitConnect/Encryption/CertificateHelper.cs
+1
-10
1 addition, 10 deletions
FitConnect/Encryption/CertificateHelper.cs
with
1 addition
and
10 deletions
FitConnect/Encryption/CertificateHelper.cs
+
1
−
10
View file @
d1a91125
using
System.Security.Cryptography
;
using
System.Security.Cryptography.X509Certificates
;
using
System.Text
;
using
System.Text.Unicode
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.IdentityModel.Tokens
;
using
Microsoft.Win32.SafeHandles
;
using
Newtonsoft.Json
;
namespace
FitConnect.Encryption
;
public
class
CertificateHelper
{
...
...
@@ -26,7 +25,6 @@ public class CertificateHelper {
LogLevel
logLevel
=
LogLevel
.
Warning
)
{
var
certificateChain
=
new
X509Chain
();
// certificate.ExportToPem($"./temp/{Guid.NewGuid().ToString()}");
_logger
?.
LogDebug
(
"Issuers: {Issuer}"
,
certificate
.
Issuer
);
if
(
rootCertificate
!=
null
)
{
...
...
@@ -65,17 +63,10 @@ public class CertificateHelper {
var
certificates
=
key
.
X5c
.
Select
(
s
=>
new
X509Certificate2
(
Convert
.
FromBase64String
(
s
)))
.
ToList
();
// if (certificates.Count != 3) {
// _logger?.Log(logLevel, "Found {Count} certificate(s) but should be 3",
// certificates.Count);
// return false;
// }
// root ??= new X509Certificate2(Convert.FromBase64String(key.X5t));
var
valid
=
certificates
.
Aggregate
(
true
,
(
result
,
cert
)
=>
result
&&
ValidateCertificate
(
cert
,
out
_
,
root
,
logLevel
)
// && cert.Verify()
);
return
valid
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment