C# Class NIST.DMC.Text4PLOT

FormatManager for non-XML file
Inheritance: FormatManager
Mostra file Open project: usnistgov/DT4SM

Protected Properties

Property Type Description
HashFunction System.Security.Cryptography.SHA256Managed

Public Methods

Method Description
EncodeAndSign ( X509Certificate2 certificate, string filePath ) : void
EncodeCMS ( X509Certificate2 certificate, String filePath ) : object
ExtractAllSignatures ( string filePath ) : List
SignFile ( String filePath, object digitalSignature ) : void
VerifyFile ( string filePath, bool>.List &verifiedCMS ) : bool

Protected Methods

Method Description
EncodeCMS ( X509Certificate2 x, byte hashedData ) : String

Signs a data hash and returns the signature

Hash ( String filePath ) : byte[]

Private Methods

Method Description
ExtractFirstSignature ( string filePath ) : String
Hash ( Stream dataStream ) : byte[]
Hash ( byte data ) : byte[]

Method Details

EncodeAndSign() public method

public EncodeAndSign ( X509Certificate2 certificate, string filePath ) : void
certificate System.Security.Cryptography.X509Certificates.X509Certificate2
filePath string
return void

EncodeCMS() protected method

Signs a data hash and returns the signature
protected EncodeCMS ( X509Certificate2 x, byte hashedData ) : String
x System.Security.Cryptography.X509Certificates.X509Certificate2 Certificate used to sign the data
hashedData byte Data digest to be signed
return String

EncodeCMS() public method

public EncodeCMS ( X509Certificate2 certificate, String filePath ) : object
certificate System.Security.Cryptography.X509Certificates.X509Certificate2
filePath String
return object

ExtractAllSignatures() public method

public ExtractAllSignatures ( string filePath ) : List
filePath string
return List

Hash() protected method

protected Hash ( String filePath ) : byte[]
filePath String
return byte[]

SignFile() public method

public SignFile ( String filePath, object digitalSignature ) : void
filePath String
digitalSignature object
return void

VerifyFile() public method

public VerifyFile ( string filePath, bool>.List &verifiedCMS ) : bool
filePath string
verifiedCMS bool>.List
return bool

Property Details

HashFunction protected_oe static_oe property

protected static SHA256Managed,System.Security.Cryptography HashFunction
return System.Security.Cryptography.SHA256Managed