EasySign BETA
Digital Signing Tool
|
Provides command definitions and handlers for the EasySign command line interface. More...
Public Member Functions | |
RootCommand | GetRootCommand () |
Gets the root command for the command line interface. | |
virtual void | RunSelfSign (bool force, string? commonName, string? email, string? organization, string? organizationalUnit, string? locality, string? state, string? country) |
Runs the self-sign command to create a self-signed root CA certificate. | |
Protected Member Functions | |
void | InitializeBundle (string bundlePath) |
Initializes the bundle. | |
bool | LoadBundle (bool readOnly=true) |
Loads the bundle from file and handles load errors. | |
virtual void | RunAdd (StatusContext statusContext, string[] files, bool replace, bool recursive, bool continueOnError, bool force) |
Runs the add command. | |
virtual void | RunInfo (StatusContext statusContext) |
Runs the info command. | |
virtual void | RunSign (StatusContext statusContext, X509Certificate2Collection certificates, bool skipVerify) |
Runs the sign command. | |
virtual bool | RunVerify (StatusContext statusContext, bool ignoreTime) |
Runs the verify command. | |
bool | VerifyCertificate (X509Certificate2 certificate, bool ignoreTime) |
Verifies the validity of a certificate. | |
bool | VerifyCertificateImpl (X509Certificate2 certificate, bool ignoreTime, out X509ChainStatus[] chainStatuses) |
Verifies the certificate using the configured trust stores. | |
CommandProvider (TConfiguration? configuration, ILogger? logger) | |
Initializes a new instance of the CommandProvider<TBundle, TConfiguration> class. | |
X509Certificate2? | GetSelfSigningRootCA () |
Gets the self-signed root CA. | |
Properties | |
TBundle? | Bundle [get, protected set] |
Gets or sets the bundle. | |
ILogger | Logger [get, set] |
Gets or sets the logger to use for logging. | |
TConfiguration | Configuration [get] |
Gets the application configurations. | |
Argument< string > | BundlePath [get] |
Gets the common argument for the bundle path. | |
Command | Add [get] |
Gets the command for creating a new bundle or updating an existing one. | |
Command | Info [get] |
Gets the command for Showing bundle information. | |
Command | Sign [get] |
Gets the command for signing bundle with one or more certificate. | |
Command | Verify [get] |
Gets the command for verifying bundle. | |
Command | SelfSign [get] |
Gets the command for generating a self-signed root CA certificate. | |
Command?? | Trust [get] |
Gets the command for managing trusted root CAs and intermediate CAs. | |
Command | Config [get] |
Gets the command for managing configuration settings. | |
Provides command definitions and handlers for the EasySign command line interface.
TBundle | The type of the bundle. |
TConfiguration | The type of the command provider configuration. |
TBundle | : | Bundle | |
TConfiguration | : | CommandProviderConfiguration | |
TConfiguration | : | new() |
Definition at line 21 of file CommandProvider.cs.
|
protected |
Initializes a new instance of the CommandProvider<TBundle, TConfiguration> class.
configuration | The configuration for the command provider. If null, a default configuration will be used. |
logger | The logger to use for logging. If null, a default null logger will be used. |
ArgumentNullException |
Definition at line 45 of file CommandProvider.cs.
References SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Configuration, and SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Logger.
|
abstract |
Gets the root command for the command line interface.
|
protected |
Gets the self-signed root CA.
Definition at line 600 of file CommandProvider.cs.
References SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Configuration.
|
abstractprotected |
Initializes the bundle.
bundlePath | Path of the bundle. |
|
protected |
Loads the bundle from file and handles load errors.
readOnly | A value indicating whether to load the bundle in read-only mode. |
Definition at line 28 of file BundleWorker.cs.
References SAPTeam.EasySign.Bundle.BundlePath, SAPTeam.EasySign.Bundle.LoadFromFile(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Logger, SAPTeam.EasySign.Bundle.Manifest, and SAPTeam.EasySign.Manifest.UpdatedBy.
Referenced by SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunAdd(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunInfo(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunSign(), and SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunVerify().
|
protectedvirtual |
Runs the add command.
statusContext | The status context for interacting with AnsiConsole.Status. |
files | The files to add to the bundle. |
replace | A value indicating whether to replace existing entries. |
recursive | A value indicating whether to add files recursively. |
continueOnError | A value indicating whether to continue adding files if an error occurs. |
force | A value indicating whether to force the addition of files to a signed bundle. |
Definition at line 83 of file BundleWorker.cs.
References SAPTeam.EasySign.Bundle.AddEntry(), SAPTeam.EasySign.Bundle.BundlePath, SAPTeam.EasySign.Bundle.DeleteEntry(), SAPTeam.EasySign.Manifest.Entries, SAPTeam.EasySign.Signatures.Entries, SAPTeam.EasySign.Manifest.GetNormalizedEntryName(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.LoadBundle(), SAPTeam.EasySign.Bundle.Loaded, SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Logger, SAPTeam.EasySign.Bundle.Manifest, SAPTeam.EasySign.Bundle.RootPath, SAPTeam.EasySign.Bundle.Signatures, and SAPTeam.EasySign.Bundle.Update().
|
protectedvirtual |
Runs the info command.
statusContext | The status context for interacting with AnsiConsole.Status. |
Definition at line 226 of file BundleWorker.cs.
References SAPTeam.EasySign.Bundle.BundlePath, SAPTeam.EasySign.Manifest.Entries, SAPTeam.EasySign.Signatures.Entries, SAPTeam.EasySign.Bundle.GetCertificate(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.LoadBundle(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Logger, SAPTeam.EasySign.Bundle.Manifest, SAPTeam.EasySign.Manifest.ProtectedEntryNames, SAPTeam.EasySign.Bundle.Signatures, SAPTeam.EasySign.Manifest.StoreOriginalFiles, and SAPTeam.EasySign.Manifest.UpdatedBy.
|
virtual |
Runs the self-sign command to create a self-signed root CA certificate.
force | A value indicating whether to force the creation of a new self-signed root CA certificate even if one already exists. |
commonName | Common Name (CN) - required. if not specified, will prompt for user input. |
Email (E) - optional. | |
organization | Organization (O) - optional. |
organizationalUnit | Organizational Unit (OU) - optional. |
locality | Locality (L) - optional. |
state | State or Province (ST) - optional. |
country | Country (C) - optional. |
Definition at line 543 of file CommandProvider.cs.
References SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Configuration, SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Logger, and SAPTeam.EasySign.CommandLine.CertificateSubject.ToString().
|
protectedvirtual |
Runs the sign command.
statusContext | The status context for interacting with AnsiConsole.Status. |
certificates | The certificates. |
skipVerify | A value indicating whether to skip certificate verification. |
Definition at line 293 of file BundleWorker.cs.
References SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.LoadBundle(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Logger, SAPTeam.EasySign.Bundle.Sign(), SAPTeam.EasySign.Bundle.Update(), and SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.VerifyCertificate().
|
protectedvirtual |
Runs the verify command.
statusContext | The status context for interacting with AnsiConsole.Status. |
ignoreTime | A value indicating whether to ignore time validity checks for certificate verification. |
true
if the verification was successful; otherwise, false
Definition at line 380 of file BundleWorker.cs.
References SAPTeam.EasySign.Manifest.Entries, SAPTeam.EasySign.Signatures.Entries, SAPTeam.EasySign.Bundle.GetCertificate(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.LoadBundle(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.Logger, SAPTeam.EasySign.Bundle.Manifest, SAPTeam.EasySign.Bundle.Signatures, SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.VerifyCertificate(), and SAPTeam.EasySign.Bundle.VerifySignature().
|
protected |
Verifies the validity of a certificate.
This method has console output. For internal usages, call VerifyCertificateImpl(X509Certificate2, bool, out X509ChainStatus[]) instead.
certificate | The certificate to verify. |
ignoreTime | A value indicating whether to ignore time validity checks. |
true
if the certificate is valid; otherwise, false
. Definition at line 555 of file BundleWorker.cs.
Referenced by SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunSign(), and SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunVerify().
|
protected |
Verifies the certificate using the configured trust stores.
certificate | The certificate to verify. |
ignoreTime | A value indicating whether to ignore time validity checks. |
chainStatuses | The chain statuses of the verification. |
true
if the certificate is valid; otherwise, false
. ApplicationException |
Definition at line 584 of file BundleWorker.cs.
References SAPTeam.EasySign.Bundle.VerifyCertificate().
|
get |
Gets the command for creating a new bundle or updating an existing one.
Definition at line 66 of file CommandProvider.cs.
|
getprotected set |
Gets or sets the bundle.
Definition at line 14 of file BundleWorker.cs.
|
getprotected |
Gets the common argument for the bundle path.
Definition at line 54 of file CommandProvider.cs.
|
get |
Gets the command for managing configuration settings.
Definition at line 467 of file CommandProvider.cs.
|
get |
Gets the application configurations.
Definition at line 33 of file CommandProvider.cs.
Referenced by SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.CommandProvider(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.GetSelfSigningRootCA(), and SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunSelfSign().
|
get |
Gets the command for Showing bundle information.
Definition at line 120 of file CommandProvider.cs.
|
getsetprotected |
Gets or sets the logger to use for logging.
Definition at line 28 of file CommandProvider.cs.
Referenced by SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.CommandProvider(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.LoadBundle(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunAdd(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunInfo(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunSelfSign(), SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunSign(), and SAPTeam.EasySign.CommandLine.CommandProvider< TBundle, TConfiguration >.RunVerify().
|
get |
Gets the command for generating a self-signed root CA certificate.
Definition at line 282 of file CommandProvider.cs.
|
get |
Gets the command for signing bundle with one or more certificate.
Definition at line 142 of file CommandProvider.cs.
|
get |
Gets the command for managing trusted root CAs and intermediate CAs.
Definition at line 339 of file CommandProvider.cs.
|
get |
Gets the command for verifying bundle.
Definition at line 256 of file CommandProvider.cs.