CryptoKeyInterface Class Reference Cryptography

#include <cryptography_key.h>

详细描述

Class to store all encryption parameters for a StreamConversionRef class. It's used to pass keys via Url to crypto file handlers.

Url aesfile( "crypto://[file:///h:/cpuinfo.txt.aes]" _s); aesfile.SetData(URL_CRYPTO_KEY,Data(CryptoKey(CryptographyClasses::AES.GetId(), 128, ( const void *) "<<SecretKey>>..." , 16 * 8))));

@MAXON_ANNOTATION{refclass=false}

公共成员函数

const MAXON_METHOD Id GetCryptoAlgorithm () const
MAXON_METHOD Int   GetBlockBitSize () const
const MAXON_METHOD void *  GetKey1 () const
MAXON_METHOD Int   GetKey1BitSize () const
const MAXON_METHOD void *  GetKey2 () const
MAXON_METHOD Int   GetKey2BitSize () const
MAXON_METHOD UInt64   GetFlags () const
const MAXON_METHOD BLOCK_CIPHER_CTR_CALLBACK GetCallbackFunction () const
MAXON_METHOD String   ToString (const FormatStatement *formatStatement=nullptr) const

静态公共成员函数

static MAXON_METHOD CryptoKeyInterface Alloc ( MAXON_SOURCE_LOCATION_DECLARATION , const Id &cryptoAlgorithm, Int blockSizeBits, const void *key1, Int key1BitSize, const void *key2=nullptr, Int key2BitSize=0, UInt64 flags=0, BLOCK_CIPHER_CTR_CALLBACK &&callback= BLOCK_CIPHER_CTR_CALLBACK ())

私有成员函数

  MAXON_INTERFACE_NONVIRTUAL ( CryptoKeyInterface , MAXON_REFERENCE_CONST , "net.maxon.interface.cryptokey")

成员函数文档编制

◆  MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( CryptoKeyInterface   ,
MAXON_REFERENCE_CONST   ,
"net.maxon.interface.cryptokey"   
)
private

◆  Alloc()

static MAXON_METHOD CryptoKeyInterface * Alloc ( MAXON_SOURCE_LOCATION_DECLARATION   ,
const Id cryptoAlgorithm ,
Int   blockSizeBits ,
const void *  key1 ,
Int   key1BitSize ,
const void *  key2 = nullptr ,
Int   key2BitSize = 0 ,
UInt64   flags = 0 ,
BLOCK_CIPHER_CTR_CALLBACK &&  callback = BLOCK_CIPHER_CTR_CALLBACK()  
)
static

Allocates the class.

参数
[in] allocLocation Pass MAXON_SOURCE_LOCATION(_NAME) to add the current source line and file.
[in] cryptoAlgorithm Id of an encryption algorithm. e.g. CryptographyClasses::AES.GetId().
[in] blockSizeBits Blocksize of the algorithm in bits.
[in] key1 Pointer to the data of key 1.
[in] key1BitSize Size of the key 1 in bits.
[in] key2 Pointer to the data of key 2.
[in] key2BitSize Size of the key 2 in bits.
[in] flags Additional flags.
[in] callback Callback function for CTR mode. Please consult the documentation of the cryptography algorithm for an explanation.

◆  GetCryptoAlgorithm()

const MAXON_METHOD Id & GetCryptoAlgorithm ( ) const

Returns the cryptography algorithm.

返回
Id of the used cryptography algorithm.

◆  GetBlockBitSize()

MAXON_METHOD Int GetBlockBitSize ( ) const

Returns the cryptography block size in bits.

返回
Block size in bits.

◆  GetKey1()

const MAXON_METHOD void* GetKey1 ( ) const

Returns the cryptography data of key 1.

返回
Pointer to the memory of key 1.

◆  GetKey1BitSize()

MAXON_METHOD Int GetKey1BitSize ( ) const

Returns the cryptography size of key 1.

返回
Key 1 size in bits.

◆  GetKey2()

const MAXON_METHOD void* GetKey2 ( ) const

Returns the cryptography data of key 2.

返回
Pointer to the memory of key 2.

◆  GetKey2BitSize()

MAXON_METHOD Int GetKey2BitSize ( ) const

Returns the cryptography size of key 2.

返回
Key 2 size in bits.

◆  GetFlags()

MAXON_METHOD UInt64 GetFlags ( ) const

Returns the additional flags.

返回
The flags.

◆  GetCallbackFunction()

const MAXON_METHOD BLOCK_CIPHER_CTR_CALLBACK & GetCallbackFunction ( ) const

Returns the callback delegate.

返回
The delegate of the callback.

◆  ToString()

MAXON_METHOD String ToString ( const FormatStatement formatStatement = nullptr ) const