File Sharding by two ways:
Date
Serial
Document digital signature.
Verify signature by two ways.
File Id
Signature
Encrypt Files by AES Algorithm.
Decrypt Files by AES Algorithm.
Generate AES key to use it at encrypt and decrypt.
Generate Private Key to use it at create digital signature.
Generate Public key to use it at Verify signature.Resize Images When download itGet document from Http Request
Assas_DMS_CS -> Core layer module has database, crud function and service actions for tables.
Assas_DMS_BL -> business layer module has all business logic at service action to use.
Assas_DMS_Timer -> contain timers for fragment and purging.
Assas_DMS_Api -> consist from many APIS to do application Job.
FileCreate
Use to create file and return file Id.
Create_file server action takes for input parameters (File_content, File_name, File_Type, IsTemp), save it and return File_Id to use at any other features.
FileDelete
Use to Delete file with specific Id.
Delete_File Server Action take file_Id and delete it from Database.
GetFile
Use to Get file with specific Id.
Get_File Server Action take file_Id and return it from Database.
GetFiles
Use to Get list of files with list of Ids.
Get_Files Server Action take list of file Ids and return with list of files from Database.
UpdateTempToRegular
Use to Update File list from temp to Current file location.
AESNewKey
Use to Generat New AES key to use it at encrypt.
AESEncrypt
Encrypt files used AES algorithm.
Takes 5 input parameters (InFileContent, InFileName, InFileType, IsTemp, AESKey) and assign it to AES_EncryptionAction which return FileId after encrypt it and save in database.
AES_EncryptionAction
Encrypt file using AES algorithm by sequence of steps: -
The user upload file.
Check if the file content is null.
If the file content is null, raises a UserException.
If the file content is not null, converts it to Base64.
Encrypt the Base64-encoded file content using AES encryption.
Convert the encrypted file content back to binary.
Create a new file with the encrypted file content.
Return New File Id.
AESDecrypt
Decrypt files used AES algorithm
Takes 2 input parameters (InFileId, Key) and assign it to AES_DecryptAction which return 3 parameters (InFileContent, InFileType, InFileName).
AES_DecryptionAction
Decrypt file using AES algorithm by sequence of steps: -
Get binary file by file Id.
Convert the file content to Base64.
Decrypt file by AES key.
Convert the Base64-file contents to the text file.
Assign all output.
GetRSAEncryptPrivateKey
Generate a new Private RSA key.
GetRSAPublicKeyByPrivateKey
Extract the public key from a private key.
SignFile
Create Digital signature.
Takes 5 input parameters (InFileContent, InFileName, InFileType, IsTemp, PrivateKey) and assign it to Create_NewSignature which return 2 parameters (FileId, Signature) after Create it and save in database.
Create_NewSignature
Create signature using RSA algorithm by sequence of steps: -
Check on document if it empty or not.
Convert file from binary to text.
Create a hash of the digital document.
Encrypt the hash using their private key.
Append the encrypted hash to the digital document as a signature.
Assign output.
Verify Signature by signature Id.
Takes 3 input parameters (InFileContent, InFileId, PublicKey) and assign it to Verify_SignatureById which return Is Valid or not.
a. Verify_SignaturebyId
Verify signature using RSA algorithm by Id by steps: -
Get file content by signature Id.
Convert file type from binary to text.
Verify signature throw public key and RSA algorithm
Return if signature valid or not.
VerifyBySignature
Verify Signature by old signature.
Takes 3 input parameters (InFileContent, InSignature, PublicKey) and assign it to Verify_BySignature which return Is Valid or not.
a. Verify_bySignature
Verify signature using RSA algorithm by Signature by steps: -
Encrypt File by AES algorithm by take structure of encrypt file information as input parameter and return file id.
Decrypt File by AES algorithm by take 2 Input parameters (FileId, Key) and return structure of file information.
GenerateNewAESKey
Generate a new AES key to use it at encrypt and decrypt methods.
GeneratPrivateKey
Generate a new RSA private key to use at create signature.
GeneratePublicKey
Generate a new RSA public key to use at verify signature.
CreateSignarture
Create Digital Signature and store it in database, take structure of signature needed data and return signature Id and Signature.
VerifySignatureBySignature
Verify signature by sending signature and new file, take (publickey, Signature, FileContent) as input parameters and return Is valid or not.
VerifySignatureById
Verify signature by sending signature Id and new file, take (publickey, FileId, FileContent) as input parameters and return Is valid or not.
Create
Upload the content wrote in the component by take File structure which held file data and return (CreateResponce) structure which consist from (Id, URL).
Download
Download the content wrote in the component by take GUID as input parameter and return file content.
DownloadResizedImage
Download The Content Wrote in The Component by take 3 parameters (GUID, width, height) as input parameters and return file content.
UpdateTempFilesToRegular
Update Temp files to Regular files by take file list as input parameter.
UploadFromHTTPRequest
Upload the content From HTTP Request by take IsTemp as an input parameter and return content.
adding another comments