Skip to content

Commit eadae99

Browse files
committed
initial commit
0 parents  commit eadae99

10 files changed

+560
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

.github/workflows/actions.yml

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**'
9+
- '!.editorconfig'
10+
- '!.gitattributes'
11+
- '!.gitignore'
12+
- '!*.md'
13+
- '!LICENSE'
14+
15+
env:
16+
VERBOSITY: 'Normal'
17+
CONFIGURATION: 'Debug'
18+
19+
jobs:
20+
Build:
21+
name: Build Console Application
22+
runs-on: [windows-latest]
23+
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v1
27+
28+
- name: Extract build information into variables
29+
id: info
30+
run: |
31+
echo "##[set-output name=build;]$(echo $(git rev-list --count HEAD))"
32+
echo "##[set-output name=copyright;]$(echo © $(date -u +%Y) Bytewizer. All rights reserved.)"
33+
34+
- name: Show build information
35+
run: |
36+
echo build=${{ steps.info.outputs.build }}
37+
echo copyright=${{ steps.info.outputs.copyright }}
38+
39+
- name: Build and publish application
40+
working-directory: src
41+
run: >-
42+
dotnet publish Bytewizer.Bytewizer.Cert2Src.sln -r win-x64 -verbosity:${env:VERBOSITY}
43+
-p:PackageOutputPath=\builds\artifacts
44+
-p:BuildNumber="${{ steps.info.outputs.build }}"
45+
-p:Copyright="${{ steps.info.outputs.copyright }}"
46+
-p:VersionPrefix="2.1.15"
47+
-p:VersionSuffix=preview.${{ steps.info.outputs.build }}
48+
-p:Configuration=${env:CONFIGURATION}
49+
50+
- name: Upload build artifacts
51+
uses: actions/[email protected]
52+
with:
53+
name: Build Packages ${{ steps.info.outputs.build }}
54+
path: \builds\artifacts

.gitignore

+101
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
# User-specific files
2+
*.suo
3+
*.user
4+
*.userosscache
5+
*.sln.docstates
6+
*.vcxproj.filters
7+
8+
# User-specific files (MonoDevelop/Xamarin Studio)
9+
*.userprefs
10+
11+
# Build results
12+
[Dd]ebug/
13+
[Dd]ebugPublic/
14+
[Rr]elease/
15+
[Rr]eleases/
16+
x64/
17+
x86/
18+
bld/
19+
[Bb]in/
20+
[Oo]bj/
21+
[Ll]og/
22+
23+
# Build packages
24+
.builds
25+
26+
# Visual Studio cache/options directory
27+
.vs/
28+
29+
# MSTest test Results
30+
[Tt]est[Rr]esult*/
31+
[Bb]uild[Ll]og.*
32+
33+
# .NET Core
34+
project.lock.json
35+
project.fragment.lock.json
36+
artifacts/
37+
**/Properties/launchSettings.json
38+
39+
*_i.c
40+
*_p.c
41+
*_i.h
42+
*.ilk
43+
*.meta
44+
*.obj
45+
*.pch
46+
*.pdb
47+
*.pgc
48+
*.pgd
49+
*.rsp
50+
*.sbr
51+
*.tlb
52+
*.tli
53+
*.tlh
54+
*.tmp
55+
*.tmp_proj
56+
*.log
57+
*.vspscc
58+
*.vssscc
59+
*.pidb
60+
*.svclog
61+
*.scc
62+
.build
63+
64+
# Visual Studio profiler
65+
*.psess
66+
*.vsp
67+
*.vspx
68+
*.sap
69+
70+
# NuGet Packages
71+
*.nupkg
72+
# The packages folder can be ignored because of Package Restore
73+
**/packages/*
74+
# except build/, which is used as an MSBuild target.
75+
!**/packages/build/
76+
# NuGet v3's project.json files produces more ignoreable files
77+
*.nuget.props
78+
*.nuget.targets
79+
# Access key file
80+
nuget-key.txt
81+
82+
# Visual Studio cache files
83+
# files ending in .cache can be ignored
84+
*.[Cc]ache
85+
# but keep track of directories ending in .cache
86+
!*.[Cc]ache/
87+
88+
# Others
89+
ClientBin/
90+
~$*
91+
*~
92+
*.dbmdl
93+
*.dbproj.schemaview
94+
*.jfm
95+
*.pfx
96+
*.publishsettings
97+
node_modules/
98+
orleans.codegen.cs
99+
100+
# Prerelease Packages
101+
!*.prerelease/packages/*.nupkg

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2018
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# cert2src
2+
3+
[![Build](https://github.com/bytewizer/runtime/actions/workflows/actions.yml/badge.svg)](https://github.com/bytewizer/runtime/actions/workflows/actions.yml)
4+
5+
This is a simple utility for download and converting / export root certificates required for [GHI Electronics TinyCLR OS](https://www.ghielectronics.com/) to access secure websites.
6+
7+
```
8+
Usage: cert2src url [options]
9+
10+
Download and export root certificates required for TinyCLR OS to access secure websites.
11+
12+
options:
13+
--help Displays general help information about other commands.
14+
--path Output chain root certificate as base-64 encoded PEM format to file.
15+
--code Set output format as csharp source code array.
16+
--width Width of the source code array output (default 18).
17+
```
18+
Note: if you do not provide a 'path' it will default to the current path.
19+
20+
## Examples
21+
```
22+
C:\project>cert2src https://www.google.com --path
23+
24+
-----BEGIN CERTIFICATE-----
25+
MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx
26+
GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds
27+
28+
[Intentionally omitted]
29+
30+
hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC
31+
X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A==
32+
-----END CERTIFICATE-----
33+
34+
Root certificate successfully exported to 'C:\project\certificate.crt'
35+
Root certificate downloaded from 'https://www.google.com/'
36+
```
37+
38+
```
39+
C:\project>cert2src https://www.google.com --path -code -width 10
40+
41+
private static readonly byte[] Certificate =
42+
{
43+
0x2d, 0x2d, 0x2d, 0x2d, 0x2d, 0x42, 0x45, 0x47, 0x49, 0x4e,
44+
0x20, 0x43, 0x45, 0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41,
45+
46+
[Intentionally omitted]
47+
48+
0x2d, 0x2d, 0x2d, 0x2d, 0x45, 0x4e, 0x44, 0x20, 0x43, 0x45,
49+
0x52, 0x54, 0x49, 0x46, 0x49, 0x43, 0x41, 0x54, 0x45, 0x2d,
50+
0x2d, 0x2d, 0x2d, 0x2d, 0x0d, 0x0a
51+
};
52+
53+
Root certificate successfully exported to 'C:\project\certificate.cs'
54+
Root certificate downloaded from 'https://www.google.com/'
55+
```
56+
57+
## Requirements
58+
59+
Software: <a href="https://visualstudio.microsoft.com/downloads/">Visual Studio 2019/2022</a> and <a href="https://www.ghielectronics.com/">GHI Electronics TinyCLR OS</a>
60+
61+
## Contributions
62+
63+
Contributions to this project are always welcome. Please consider forking this project on GitHub and sending a pull request to get your improvements added to the original project.
64+
65+
## Disclaimer
66+
67+
All source, documentation, instructions and products of this project are provided as-is without warranty. No liability is accepted for any damages, data loss or costs incurred by its use.

images/package-logo.png

1.98 KB
Loading

src/.editorconfig

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[*.cs]
2+
3+
# Default severity for analyzer diagnostics with category 'Style'
4+
dotnet_analyzer_diagnostic.category-Style.severity = none
5+
6+
# SYSLIB0014: Type or member is obsolete
7+
dotnet_diagnostic.SYSLIB0014.severity = none

src/Bytewizer.Cert2Src.sln

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.3.32825.248
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "cert2src", "cert2src.csproj", "{9C90CF4A-ACF3-42F6-AA21-988BAD62FE2A}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{7EFFDF24-65DC-4D35-BAA7-A4F451666CC1}"
9+
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
11+
EndProjectSection
12+
EndProject
13+
Global
14+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
15+
Debug|Any CPU = Debug|Any CPU
16+
Release|Any CPU = Release|Any CPU
17+
EndGlobalSection
18+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
19+
{9C90CF4A-ACF3-42F6-AA21-988BAD62FE2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
20+
{9C90CF4A-ACF3-42F6-AA21-988BAD62FE2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
21+
{9C90CF4A-ACF3-42F6-AA21-988BAD62FE2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
22+
{9C90CF4A-ACF3-42F6-AA21-988BAD62FE2A}.Release|Any CPU.Build.0 = Release|Any CPU
23+
EndGlobalSection
24+
GlobalSection(SolutionProperties) = preSolution
25+
HideSolutionNode = FALSE
26+
EndGlobalSection
27+
GlobalSection(ExtensibilityGlobals) = postSolution
28+
SolutionGuid = {BDD73A25-CB84-4571-BCD3-0376415E3AD9}
29+
EndGlobalSection
30+
EndGlobal

0 commit comments

Comments
 (0)