Machina Client SDK Version 2.1.2
Ionic Security Machina Client SDK for Python users
Public Member Functions | List of all members
ionicsdk.filecipher.FileCipherBase Class Reference

Base class for all file encryption / decryption ciphers. More...

Inheritance diagram for ionicsdk.filecipher.FileCipherBase:
ionicsdk.filecipher.FileCipherAuto ionicsdk.filecipher.FileCipherCms ionicsdk.filecipher.FileCipherCsv ionicsdk.filecipher.FileCipherGeneric ionicsdk.filecipher.FileCipherOpenXml ionicsdk.filecipher.FileCipherPdf

Public Member Functions

def __init__ (self)
 Constructs a file cipher with default values.
 
def family (self)
 Access the instance FileCipherFamily enumeration. More...
 
def familystring (self)
 Access the instance FileCipherFamily string. More...
 
def getLastServerResponse (self)
 Return the Server Response object from the last Agent call. More...
 
def encryptbytes (self, plaintextbytes, attributes=None, metadata=None, mutableAttributes=None)
 Encrypts an input byte buffer into an output byte buffer. More...
 
def encryptbytes2 (self, plaintextbytes, encryptattributesInOut)
 Encrypts an input byte buffer into an output byte buffer. More...
 
def decryptbytes (self, ciphertextbytes, metadata=None)
 Decrypts an input buffer into an output buffer. More...
 
def decryptbytes2 (self, ciphertextbytes, decryptattributesInOut)
 Decrypts an input byte buffer into an output byte buffer. More...
 
def encryptinplace (self, filepath, attributes=None, metadata=None, mutableAttributes=None)
 Encrypts a file in-place. More...
 
def encryptinplace2 (self, filepath, encryptattributesInOut)
 Encrypts a file in-place. More...
 
def decryptinplace (self, filepath, metadata=None)
 Decrypts a file in-place. More...
 
def decryptinplace2 (self, filepath, decryptattributesInOut)
 Decrypts a file in-place. More...
 
def encrypt (self, sourcepath, destpath, attributes=None, metadata=None, mutableAttributes=None)
 Encrypts an input file into an output file. More...
 
def encrypt2 (self, sourcepath, destpath, encryptattributesInOut)
 Encrypts an input file into an output file. More...
 
def decrypt (self, sourcepath, destpath, metadata=None)
 Decrypts an input file into an output output file. More...
 
def decrypt2 (self, sourcepath, destpath, decryptattributesInOut)
 Decrypts an input file into an output output file. More...
 
def getinfobytes (self, inputbytes)
 Determines if a file is Ionic protected and various pieces of information about the file. More...
 
def getinfo (self, filepath)
 Determines if a file is Ionic protected and various pieces of information about the file. More...
 

Detailed Description

Base class for all file encryption / decryption ciphers.

Not to be used directly. Use one of the appropriate subclasses:

Member Function Documentation

◆ decrypt()

def ionicsdk.filecipher.FileCipherBase.decrypt (   self,
  sourcepath,
  destpath,
  metadata = None 
)

Decrypts an input file into an output output file.

This function performs file decryption using the method implied by the class name (e.g. FileCipherOpenXml).

If the source and destination paths point to the same physical file, then in-place decryption will be performed automatically. However, it is recommended to perform in-place decryption using the function dedicated for that purpose (decryptinplace)).

Parameters
sourcepath(string): The input file path.
destpath(string): The output file path.
metadata(metadataDict, optional): The metadata properties to send along with the HTTP request.
Returns
None

◆ decrypt2()

def ionicsdk.filecipher.FileCipherBase.decrypt2 (   self,
  sourcepath,
  destpath,
  decryptattributesInOut 
)

Decrypts an input file into an output output file.

This function performs file decryption using the method implied by the class name (e.g. FileCipherOpenXml).

If the source and destination paths point to the same physical file, then in-place decryption will be performed automatically. However, it is recommended to perform in-place decryption using the function dedicated for that purpose (decryptinplace)).

Parameters
sourcepath(string): The input file path.
destpath(string): The output file path.
decryptattributesInOut(FileCipherDecryptAttributes): Object to provide and return detailed information.
Returns
None

◆ decryptbytes()

def ionicsdk.filecipher.FileCipherBase.decryptbytes (   self,
  ciphertextbytes,
  metadata = None 
)

Decrypts an input buffer into an output buffer.

This function performs file decryption using the method implied by the class name (e.g. FileCipherOpenXml).

Parameters
ciphertextbytes(bytes): The binary ciphertext input buffer.
metadata(metadataDict, optional): The metadata properties to send along with the HTTP request.
Returns
The plaintext output buffer.

◆ decryptbytes2()

def ionicsdk.filecipher.FileCipherBase.decryptbytes2 (   self,
  ciphertextbytes,
  decryptattributesInOut 
)

Decrypts an input byte buffer into an output byte buffer.

This function performs file encryption using the method implied by the class name (e.g. FileCipherOpenXml).

Parameters
ciphertextbytes(bytes): The binary ciphertext input buffer.
decryptattributesInOut(FileCipherDecryptAttributes): Object to provide and return detailed information.
Returns
The plaintext output buffer. The decryptattributesInOut paramater will also be modified.

◆ decryptinplace()

def ionicsdk.filecipher.FileCipherBase.decryptinplace (   self,
  filepath,
  metadata = None 
)

Decrypts a file in-place.

This function performs in-place file decryption, which means that the file specified by the filepath parameter will be overwritten with the resulting decrypted plaintext. If decryption fails, it is guaranteed that the original ciphertext file will not be modified in any way.

You must have write access to the file specified by the filepath parameter. If you do not have write access, the most likely error code that you will receive is FILECRYPTO_RENAMEFILE.

Parameters
filepath(string): The file to be decrypted in place.
metadata(metadataDict, optional): The metadata properties to send along with the HTTP request.
Returns
None

◆ decryptinplace2()

def ionicsdk.filecipher.FileCipherBase.decryptinplace2 (   self,
  filepath,
  decryptattributesInOut 
)

Decrypts a file in-place.

This function performs in-place file decryption, which means that the file specified by the filepath parameter will be overwritten with the resulting decrypted plaintext. If decryption fails, it is guaranteed that the original ciphertext file will not be modified in any way.

You must have write access to the file specified by the filepath parameter. If you do not have write access, the most likely error code that you will receive is FILECRYPTO_RENAMEFILE.

Parameters
filepath(string): The file to be decrypted in place.
decryptattributesInOut(FileCipherDecryptAttributes): Object to provide and return detailed information.
Returns
None

◆ encrypt()

def ionicsdk.filecipher.FileCipherBase.encrypt (   self,
  sourcepath,
  destpath,
  attributes = None,
  metadata = None,
  mutableAttributes = None 
)

Encrypts an input file into an output file.

This function performs file encryption using the method implied by the class name (e.g. FileCipherOpenXml).

If the source and destination paths point to the same physical file, then in-place encryption will be performed automatically. However, it is recommended to perform in-place encryption using the function dedicated for that purpose (encryptinplace).

Parameters
sourcepath(string): The input file path.
destpath(string): The output file path.
attributes(keyAttributesDict, optional): The attributes to use when creating a key to protect data.
metadata(metadataDict, optional): The metadata properties to send along with the HTTP request.
mutableAttributes(keyAttributesDict): The key mutable attributes to associate with data chunk protection key.
Returns
None

◆ encrypt2()

def ionicsdk.filecipher.FileCipherBase.encrypt2 (   self,
  sourcepath,
  destpath,
  encryptattributesInOut 
)

Encrypts an input file into an output file.

This function performs file encryption using the method implied by the class name (e.g. FileCipherOpenXml).

If the source and destination paths point to the same physical file, then in-place encryption will be performed automatically. However, it is recommended to perform in-place encryption using the function dedicated for that purpose (encryptinplace).

Parameters
sourcepath(string): The input file path.
destpath(string): The output file path.
encryptattributesInOut(FileCipherEncryptAttributes): Object to provide and return detailed information.
Returns
None

◆ encryptbytes()

def ionicsdk.filecipher.FileCipherBase.encryptbytes (   self,
  plaintextbytes,
  attributes = None,
  metadata = None,
  mutableAttributes = None 
)

Encrypts an input byte buffer into an output byte buffer.

This function performs file encryption using the method implied by the class name (e.g. FileCipherOpenXml).

Parameters
plaintextbytes(bytes): The binary plaintext input buffer.
attributes(keyAttributesDict, optional): The attributes to use when creating a key to protect data.
metadata(metadataDict, optional): The metadata properties to send along with the HTTP request.
mutableAttributes(keyAttributesDict): The key mutable attributes to associate with data chunk protection key.
Returns
The ciphertext output buffer.

◆ encryptbytes2()

def ionicsdk.filecipher.FileCipherBase.encryptbytes2 (   self,
  plaintextbytes,
  encryptattributesInOut 
)

Encrypts an input byte buffer into an output byte buffer.

This function performs file encryption using the method implied by the class name (e.g. FileCipherOpenXml).

Parameters
plaintextbytes(bytes): The binary plaintext input buffer.
encryptattributesInOut(FileCipherEncryptAttributes): Object to provide and return detailed information.
Returns
The ciphertext output buffer. The encryptattributesInOut paramater will also be modified.

◆ encryptinplace()

def ionicsdk.filecipher.FileCipherBase.encryptinplace (   self,
  filepath,
  attributes = None,
  metadata = None,
  mutableAttributes = None 
)

Encrypts a file in-place.

This function performs in-place file encryption, which means that the file specified by the filepath parameter will be overwritten with the resulting encrypted ciphertext. If decryption fails, it is guaranteed that the original ciphertext file will not be modified in any way.

You must have write access to the file specified by the filepath parameter. If you do not have write access, the most likely error code that you will receive is FILECRYPTO_RENAMEFILE.

Parameters
filepath(string): The file to be encrypted in place.
attributes(keyAttributesDict, optional): The attributes to use when creating a key to protect data.
metadata(metadataDict, optional): The metadata properties to send along with the HTTP request.
mutableAttributes(keyAttributesDict): The key mutable attributes to associate with data chunk protection key.
Returns
None

◆ encryptinplace2()

def ionicsdk.filecipher.FileCipherBase.encryptinplace2 (   self,
  filepath,
  encryptattributesInOut 
)

Encrypts a file in-place.

This function performs in-place file encryption, which means that the file specified by the filepath parameter will be overwritten with the resulting encrypted ciphertext. If decryption fails, it is guaranteed that the original ciphertext file will not be modified in any way.

You must have write access to the file specified by the filepath parameter. If you do not have write access, the most likely error code that you will receive is FILECRYPTO_RENAMEFILE.

Parameters
filepath(string): The file to be encrypted in place.
encryptattributesInOut(FileCipherEncryptAttributes): Object to provide and return detailed information.
Returns
None

◆ family()

def ionicsdk.filecipher.FileCipherBase.family (   self)

Access the instance FileCipherFamily enumeration.

Returns
(FileCipherFamily) File Cipher Family enumeration

◆ familystring()

def ionicsdk.filecipher.FileCipherBase.familystring (   self)

Access the instance FileCipherFamily string.

Returns
(string) File Cipher Family string

◆ getinfo()

def ionicsdk.filecipher.FileCipherBase.getinfo (   self,
  filepath 
)

Determines if a file is Ionic protected and various pieces of information about the file.

Parameters
filepath(string): The input file path.
Returns
The FileInfo output object.

◆ getinfobytes()

def ionicsdk.filecipher.FileCipherBase.getinfobytes (   self,
  inputbytes 
)

Determines if a file is Ionic protected and various pieces of information about the file.

Parameters
inputbytes(bytes): The data input.
Returns
The FileInfo output object.

◆ getLastServerResponse()

def ionicsdk.filecipher.FileCipherBase.getLastServerResponse (   self)

Return the Server Response object from the last Agent call.

Returns
A valid ServerResponse object or None if no server calls have been made yet.

The documentation for this class was generated from the following file: