AESFile Class Reference

#include <c4d_file.h>

Inheritance diagram for AESFile:

详细描述

File operations for AES encrypted files.

注意
Has to be created with Alloc() and destroyed with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

公共成员函数

Bool   Open (const Filename &name, const char *key, Int32 keylen, Int32 blocksize, UInt32 aes_flags, FILEOPEN mode= FILEOPEN::READ , FILEDIALOG error_dialog= FILEDIALOG::IGNOREOPEN , BYTEORDER order= BYTEORDER::V_MOTOROLA , Int32 type='C4DC', Int32 creator='C4D1')
-  Public Member Functions inherited from BaseFile
Bool   Open (const Filename &name, FILEOPEN mode= FILEOPEN::READ , FILEDIALOG error_dialog= FILEDIALOG::IGNOREOPEN , BYTEORDER order= BYTEORDER::V_MOTOROLA , Int32 type='C4DC', Int32 creator='C4D1')
Bool   关闭 ()
Int   ReadBytes (void *data, Int len, Bool just_try_it=false)
Int   TryReadBytes (void *data, Int len)
Bool   WriteBytes (const void *data, Int len)
Bool   Seek ( Int64 pos, FILESEEK mode= FILESEEK::RELATIVE_ )
Int64   GetPosition ()
Int64   GetLength ()
LOCATION   GetLocation () const
FILEERROR   GetError () const
void  SetError ( FILEERROR error)
void  SetOrder ( BYTEORDER order)
Bool   ReadChar ( Char *v)
Bool   ReadUChar ( UChar *v)
Bool   ReadInt16 ( Int16 *v)
Bool   ReadUInt16 ( UInt16 *v)
Bool   ReadInt32 ( Int32 *v)
Bool   ReadUInt32 ( UInt32 *v)
Bool   ReadFloat32 ( Float32 *v)
Bool   ReadFloat64 ( Float64 *v)
Bool   ReadInt64 ( Int64 *v)
Bool   ReadUInt64 ( UInt64 *v)
Bool   ReadFilename ( Filename *v)
Bool   ReadBool ( Bool *v)
Bool   ReadString ( maxon::String *v)
Bool   ReadVector32 ( Vector32 *v)
Bool   ReadVector64 ( Vector64 *v)
Bool   ReadMatrix32 ( Matrix32 *v)
Bool   ReadMatrix64 ( Matrix64 *v)
Bool   WriteChar ( Char v)
Bool   WriteUChar ( UChar v)
Bool   WriteInt16 ( Int16 v)
Bool   WriteUInt16 ( UInt16 v)
Bool   WriteInt32 ( Int32 v)
Bool   WriteUInt32 ( UInt32 v)
Bool   WriteFloat32 ( Float32 v)
Bool   WriteFloat64 ( Float64 v)
Bool   WriteInt64 ( Int64 v)
Bool   WriteUInt64 ( UInt64 v)
Bool   WriteFilename (const Filename &v)
Bool   WriteBool ( Bool v)
Bool   WriteString (const maxon::String &v)
Bool   WriteVector32 (const Vector32 &v)
Bool   WriteVector64 (const Vector64 &v)
Bool   WriteMatrix32 (const Matrix32 &v)
Bool   WriteMatrix64 (const Matrix64 &v)

静态公共成员函数

static Bool   CheckEncryption (const Filename &encrypt, const Filename &decrypt, const char *key, Int32 keylen, Int32 blocksize)
-  Static Public Member Functions inherited from BaseFile
static BaseFile Alloc (void)
static void  Free ( BaseFile *&fl)

私有成员函数

  AESFile ()
  ~AESFile ()

Alloc/Free

static AESFile Alloc (void)
static void  Free ( AESFile *&fl)

构造函数 & 析构函数文档编制

◆  AESFile()

AESFile () private

◆  ~AESFile()

~ AESFile () private

成员函数文档编制

◆  Alloc()

static AESFile * Alloc ( void  )
static

Allocates a AES file. Destroy the allocated AES file with Free() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

返回
The allocated AES file, or nullptr if the allocation failed.

◆  Free()

static void Free ( AESFile *&  fl )
static

Destructs AES files allocated with Alloc() 。使用 AutoAlloc to automate the allocation and destruction based on scope.

参数
[in,out] fl The AES file to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆  Open()

Bool Open ( const Filename name ,
const char *  key ,
Int32   keylen ,
Int32   blocksize ,
UInt32   aes_flags ,
FILEOPEN   mode = FILEOPEN::READ ,
FILEDIALOG   error_dialog = FILEDIALOG::IGNOREOPEN ,
BYTEORDER   order = BYTEORDER::V_MOTOROLA ,
Int32   type = 'C4DC' ,
Int32   creator = 'C4D1'  
)

Opens a AES encrypted file.

警告
For a plugin to be cross platform then the type and creator parameters must be correctly filled for Mac.
参数
[in] name The name of the file to open.
[in] key The decryption key. The caller owns the pointed buffer.
[in] keylen The key length. Must be 128 , 192 or 256 (bits).
[in] blocksize The block size. Must be 128 , 192 or 256 (bits).
[in] aes_flags Reserved for later use. Must be set to 0 .
[in] mode The file access mode: FILEOPEN
[in] error_dialog Sets the type of error reporting that should happen during the file opening: FILEDIALOG
[in] order The type of byte order in the AES 文件: BYTEORDER
[in] type The type of file, only applies to Mac: MACTYPE_CINEMA .
[in] creator The application that wrote the file, for example 'ttxt' (SimpleText) or 'C4D1' for Cinema 4D , only relevant to Mac: MACCREATOR_CINEMA .
返回
true if the file was opened without any problem, otherwise false .

◆  CheckEncryption()

static Bool CheckEncryption ( const Filename encrypt ,
const Filename decrypt ,
const char *  key ,
Int32   keylen ,
Int32   blocksize  
)
static

Checks if the encrypted file is the encrypted version of the decrypted file.

参数
[in] encrypt The filename of the encrypted file.
[in] decrypt The filename of the decrypted file.
[in] key The decryption key. The caller owns the pointed buffer.
[in] keylen The key length. Must be 128 , 192 or 256 (bits).
[in] blocksize The block size. Must be 128 , 192 or 256 (bits).
返回
true if the encrypted file is the encrypted version of the decrypted file, otherwise false .