C# Class NetSparkle.NetSparkleDSAVerificator

Class to verify a DSA signature
Show file Open project: Deadpikle/NetSparkle Class Usage Examples

Public Methods

Method Description
NetSparkleDSAVerificator ( SecurityMode mode, String publicKey = null, String publicKeyFile = "NetSparkle_DSA.pub" ) : System

Constructor

PublicKeyExists ( ) : System.Boolean

Determines if a public key exists

SignatureNeeded ( ) : bool

Returns if we need an signature

VerifyDSASignature ( String signature, Stream stream ) : ValidationResult

Verifies the DSA signature

VerifyDSASignatureFile ( String signature, String binaryPath ) : ValidationResult

Verifies the DSA signature

VerifyDSASignatureOfString ( String signature, String data ) : ValidationResult

Verifies the DSA signature of string data

Private Methods

Method Description
CheckSecurityMode ( String signature, ValidationResult &result ) : System.Boolean
TryGetFileResource ( String publicKey, Stream data ) : Stream

Gets a file resource

TryGetResourceStream ( String publicKey ) : Stream

Get a resource stream

Method Details

NetSparkleDSAVerificator() public method

Constructor
public NetSparkleDSAVerificator ( SecurityMode mode, String publicKey = null, String publicKeyFile = "NetSparkle_DSA.pub" ) : System
mode SecurityMode The security mode of the validator. Control what parts has to be exist
publicKey String the public key as string (will be prefered before the file)
publicKeyFile String the public key file
return System

PublicKeyExists() public method

Determines if a public key exists
public PublicKeyExists ( ) : System.Boolean
return System.Boolean

SignatureNeeded() public method

Returns if we need an signature
public SignatureNeeded ( ) : bool
return bool

VerifyDSASignature() public method

Verifies the DSA signature
public VerifyDSASignature ( String signature, Stream stream ) : ValidationResult
signature String expected signature
stream Stream the stream of the binary
return ValidationResult

VerifyDSASignatureFile() public method

Verifies the DSA signature
public VerifyDSASignatureFile ( String signature, String binaryPath ) : ValidationResult
signature String expected signature
binaryPath String the path to the binary
return ValidationResult

VerifyDSASignatureOfString() public method

Verifies the DSA signature of string data
public VerifyDSASignatureOfString ( String signature, String data ) : ValidationResult
signature String expected signature
data String the data
return ValidationResult