Crypteron C# API  2015.6.1.0
Crypteron.CipherStor.CipherStorExt Class Reference

This is the CipherDb Blob class for securing files in Blob storage via the same key management system More...

Public Member Functions

 CipherStorExt (string securityPartition=Default.PartitionId, string asRole=Default.RoleId)
 Creates a CipherStor class to allow for file or streaming based operations. More...
 
void SetBlobTarget (string filename, string containerName, CloudStorageAccount cloudStorageAccount, bool addCipherStorFileExtension=true)
 If using Azure Blob (Binary Large OBject) storage, you can specify the location More...
 
void EncryptStream (Stream clearInputStream, Stream encryptedOutputStream, bool compress=false, CancellationToken cancellationToken=default(CancellationToken), bool keepOutputStreamOpen=false)
 This will take an input stream and encrypt it to the output stream More...
 
void DecryptStream (Stream encryptedInputStream, Stream clearOutputStream, CancellationToken cancellationToken=default(CancellationToken), bool keepInputStreamOpen=false)
 This decrypts an encrypted input stream to a clear output stream More...
 
void EncryptLocalFile (string clearInputFile, string encryptedOutputFile, bool compress=false, CancellationToken cancellationToken=default(CancellationToken))
 This will take an input file and encrypt it to another file More...
 
void DecryptLocalFile (string encryptInFile, string clearOutFile, CancellationToken cancellationToken=default(CancellationToken))
 This will take an encrypted file and decrypt it to another file More...
 
void UploadFromFile (string filePath, bool compress=false, CancellationToken cancellationToken=default(CancellationToken))
 
void DownloadToFile (string filePath, CancellationToken cancellationToken=default(CancellationToken))
 
void UploadFromStream (Stream clearStream, [Optional] AccessCondition accessCondition, [Optional] BlobRequestOptions blobRequestOptions, [Optional] OperationContext operationContext, bool compress=false, CancellationToken cancellationToken=default(CancellationToken))
 CipherStor API to upload a clear stream to Blob Storage as an encrypted blob More...
 
void DownloadToStream (Stream clearStream, [Optional] AccessCondition accessCondition, [Optional] BlobRequestOptions blobRequestOptions, [Optional] OperationContext operationContext, CancellationToken cancellationToken=default(CancellationToken))
 CipherStor API to download an encrypted blob as a clear stream. The downloading and decryption happens on the fly. Errors, if any, will be presented as exceptions. More...
 

Events

EventHandler< CipherCoreEventArgs > RaiseProgressEvent
 An event is you want to be notified of ongoing progress. The reporting internal This is configured in your config file within the cipherStorConfig via the ReportEveryXBytes parameter More...
 

Detailed Description

This is the CipherDb Blob class for securing files in Blob storage via the same key management system

Constructor & Destructor Documentation

Crypteron.CipherStor.CipherStorExt.CipherStorExt ( string  securityPartition = Default.PartitionId,
string  asRole = Default.RoleId 
)

Creates a CipherStor class to allow for file or streaming based operations.

Parameters
securityPartitionOptional argument specifying the security partition this object should be sealed for. If not specified, the default security partition is used.
asRoleOptional argument specifying the role that should be sealing this object. If not specified, the default role is used.

Member Function Documentation

void Crypteron.CipherStor.CipherStorExt.DecryptLocalFile ( string  encryptInFile,
string  clearOutFile,
CancellationToken  cancellationToken = default(CancellationToken) 
)

This will take an encrypted file and decrypt it to another file

Parameters
encryptInFileThe encrypted input file
clearOutFileTeh clear output file
cancellationTokenOptionally allow for cancellations
void Crypteron.CipherStor.CipherStorExt.DecryptStream ( Stream  encryptedInputStream,
Stream  clearOutputStream,
CancellationToken  cancellationToken = default(CancellationToken),
bool  keepInputStreamOpen = false 
)

This decrypts an encrypted input stream to a clear output stream

Parameters
encryptedInputStreamThe encrypted input stream
clearOutputStreamThe clear output stream
cancellationTokenOptionally allow for cancellations
keepInputStreamOpenKeep the input encrypted stream open at the end of the operation
void Crypteron.CipherStor.CipherStorExt.DownloadToFile ( string  filePath,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Parameters
filePath
cancellationTokenOptionally allow for cancellations
void Crypteron.CipherStor.CipherStorExt.DownloadToStream ( Stream  clearStream,
[Optional] AccessCondition  accessCondition,
[Optional] BlobRequestOptions  blobRequestOptions,
[Optional] OperationContext  operationContext,
CancellationToken  cancellationToken = default(CancellationToken) 
)

CipherStor API to download an encrypted blob as a clear stream. The downloading and decryption happens on the fly. Errors, if any, will be presented as exceptions.

Parameters
clearStreamThe stream which will bear the decrypted contents of the encrypted blob.
accessConditionAccess Conditions per Core Azure Storage API. Represents a set of access conditions to be used for operations against the storage services.
blobRequestOptionsBlob request options per Core Azure Storage API. Represents a set of timeout and retry policy options that may be specified for a blob operation request.
operationContextOperation Context per Core Azure Storage API. Represents the context for a request to the storage service and provides additional runtime information about its execution.
cancellationTokenOptionally allow for cancellations
void Crypteron.CipherStor.CipherStorExt.EncryptLocalFile ( string  clearInputFile,
string  encryptedOutputFile,
bool  compress = false,
CancellationToken  cancellationToken = default(CancellationToken) 
)

This will take an input file and encrypt it to another file

Parameters
clearInputFileThe clear input file
encryptedOutputFileThe encrypted output file
compressOptionally enable compression
cancellationTokenOptionally allow for cancellations
void Crypteron.CipherStor.CipherStorExt.EncryptStream ( Stream  clearInputStream,
Stream  encryptedOutputStream,
bool  compress = false,
CancellationToken  cancellationToken = default(CancellationToken),
bool  keepOutputStreamOpen = false 
)

This will take an input stream and encrypt it to the output stream

Parameters
clearInputStreamThe clear input stream
encryptedOutputStreamThe encrypted output stream
compressOptionally enable compression
cancellationTokenOptionally allow for cancellations
keepOutputStreamOpenOptionally keep the output stream open
void Crypteron.CipherStor.CipherStorExt.SetBlobTarget ( string  filename,
string  containerName,
CloudStorageAccount  cloudStorageAccount,
bool  addCipherStorFileExtension = true 
)

If using Azure Blob (Binary Large OBject) storage, you can specify the location

Parameters
filenameThe name of the resulting Blob
containerNameThe container within which the Blob resides
cloudStorageAccountYour blob storage account
addCipherStorFileExtensionAdd the CipherStor file extension to indicate the Blob's encrypted state
void Crypteron.CipherStor.CipherStorExt.UploadFromFile ( string  filePath,
bool  compress = false,
CancellationToken  cancellationToken = default(CancellationToken) 
)

Parameters
filePath
compress
cancellationTokenOptionally allow for cancellations
void Crypteron.CipherStor.CipherStorExt.UploadFromStream ( Stream  clearStream,
[Optional] AccessCondition  accessCondition,
[Optional] BlobRequestOptions  blobRequestOptions,
[Optional] OperationContext  operationContext,
bool  compress = false,
CancellationToken  cancellationToken = default(CancellationToken) 
)

CipherStor API to upload a clear stream to Blob Storage as an encrypted blob

Parameters
clearStreamThe clear stream to be encrypted
accessConditionAccess Conditions per Core Azure Storage API. Represents a set of access conditions to be used for operations against the storage services.
blobRequestOptionsBlob request options per Core Azure Storage API. Represents a set of timeout and retry policy options that may be specified for a blob operation request.
operationContextOperation Context per Core Azure Storage API. Represents the context for a request to the storage service and provides additional runtime information about its execution.
compressEnable compressed encryption
cancellationTokenOptionally allow for cancellations

Event Documentation

EventHandler< CipherCoreEventArgs> Crypteron.CipherStor.CipherStorExt.RaiseProgressEvent

An event is you want to be notified of ongoing progress. The reporting internal This is configured in your config file within the cipherStorConfig via the ReportEveryXBytes parameter