CryptoKeyInterface Class Reference

#include <cryptography_key.h>

Detailed Description

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))));

{refclass=false}

Public Member Functions

MAXON_METHOD const IdGetCryptoAlgorithm () const
 
MAXON_METHOD Int GetBlockBitSize () const
 
MAXON_METHOD const void * GetKey1 () const
 
MAXON_METHOD Int GetKey1BitSize () const
 
MAXON_METHOD const void * GetKey2 () const
 
MAXON_METHOD Int GetKey2BitSize () const
 
MAXON_METHOD UInt64 GetFlags () const
 
MAXON_METHOD const BLOCK_CIPHER_CTR_CALLBACKGetCallbackFunction () const
 
MAXON_METHOD String ToString (const FormatStatement *formatStatement) const
 

Static Public Member Functions

static MAXON_METHOD CryptoKeyInterfaceAlloc (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())
 

Private Member Functions

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

Member Function Documentation

◆ 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.

Parameters
[in]allocLocationPass MAXON_SOURCE_LOCATION(_NAME) to add the current source line and file.
[in]cryptoAlgorithmId of an encryption algorithm. e.g. CryptographyClasses::AES.GetId().
[in]blockSizeBitsBlocksize of the algorithm in bits.
[in]key1Pointer to the data of key 1.
[in]key1BitSizeSize of the key 1 in bits.
[in]key2Pointer to the data of key 2.
[in]key2BitSizeSize of the key 2 in bits.
[in]flagsAdditional flags.
[in]callbackCallback function for CTR mode. Please consult the documentation of the cryptography algorithm for an explanation.

◆ GetCryptoAlgorithm()

MAXON_METHOD const Id& GetCryptoAlgorithm ( ) const

Returns the cryptography algorithm.

Returns
Id of the used cryptography algorithm.

◆ GetBlockBitSize()

MAXON_METHOD Int GetBlockBitSize ( ) const

Returns the cryptography block size in bits.

Returns
Block size in bits.

◆ GetKey1()

MAXON_METHOD const void* GetKey1 ( ) const

Returns the cryptography data of key 1.

Returns
Pointer to the memory of key 1.

◆ GetKey1BitSize()

MAXON_METHOD Int GetKey1BitSize ( ) const

Returns the cryptography size of key 1.

Returns
Key 1 size in bits.

◆ GetKey2()

MAXON_METHOD const void* GetKey2 ( ) const

Returns the cryptography data of key 2.

Returns
Pointer to the memory of key 2.

◆ GetKey2BitSize()

MAXON_METHOD Int GetKey2BitSize ( ) const

Returns the cryptography size of key 2.

Returns
Key 2 size in bits.

◆ GetFlags()

MAXON_METHOD UInt64 GetFlags ( ) const

Returns the additional flags.

Returns
The flags.

◆ GetCallbackFunction()

MAXON_METHOD const BLOCK_CIPHER_CTR_CALLBACK& GetCallbackFunction ( ) const

Returns the callback delegate.

Returns
The delegate of the callback.

◆ ToString()

MAXON_METHOD String ToString ( const FormatStatement formatStatement) const