CKeyStore

class Lib3MF::CKeyStore : public CBase
PConsumer AddConsumer(const std::string &sConsumerID, const std::string &sKeyID, const std::string &sKeyValue)

Adds a consumer to the keystore

Parameters:
  • sConsumerID – A unique identifier for the consumer

  • sKeyID – The id of the key of the consumer

  • sKeyValue – The public key for this consumer in PEM format

Returns:

The consumer instance

Lib3MF_uint64 GetConsumerCount()

Gets the number of consumers in the keystore

Returns:

The consumer count

PConsumer GetConsumer(const Lib3MF_uint64 nConsumerIndex)

Get a consumer from the keystore

Parameters:

nConsumerIndex – The index of the consumer

Returns:

The consumer instance

void RemoveConsumer(CConsumer *pConsumer)

Removes a consumer from the keystore

Parameters:

pConsumer – The consumer instance to remove

PConsumer FindConsumer(const std::string &sConsumerID)

Finds a consumer by ID

Parameters:

sConsumerID – The ID of the consumer

Returns:

The consumer instance

Lib3MF_uint64 GetResourceDataGroupCount()

Gets the number of resource data group in the keysore

Returns:

The number of resource data available

PResourceDataGroup AddResourceDataGroup()

Adds a resource data group into the keystore.

Returns:

The resource data group instance

PResourceDataGroup GetResourceDataGroup(const Lib3MF_uint64 nResourceDataIndex)

Gets a resource data group

Parameters:

nResourceDataIndex – The index of the resource data

Returns:

The resource data group instance

void RemoveResourceDataGroup(CResourceDataGroup *pResourceDataGroup)

Removes a resource data group

Parameters:

pResourceDataGroup – The resource data group instance

PResourceDataGroup FindResourceDataGroup(CPackagePart *pPartPath)

Finds a resource data group that contains a particular resourcedata

Parameters:

pPartPath – The target path for the resourcedata hold by the resource data group

Returns:

The data resource instance

PResourceData AddResourceData(CResourceDataGroup *pResourceDataGroup, CPackagePart *pPartPath, const eEncryptionAlgorithm eAlgorithm, const eCompression eCompression, const CInputVector<Lib3MF_uint8> &AdditionalAuthenticationDataBuffer)

Add resourcedata to resourcedatagroup element

Parameters:
  • pResourceDataGroup – The resource data group where to add this resource data

  • pPartPath – The path of the part to be encrypted

  • eAlgorithm – The encryption algorithm to be used to encrypt this resource

  • eCompression – Whether compression should be used prior to encryption

  • AdditionalAuthenticationDataBuffer – Additional data to be encrypted along the contents for better security

Returns:

The data resource instance

void RemoveResourceData(CResourceData *pResourceData)

Removes a resource data

Parameters:

pResourceData – The resource data to be removed

PResourceData FindResourceData(CPackagePart *pResourcePath)

Finds a resource data on this resource group

Parameters:

pResourcePath – The target path for the resourcedata

Returns:

The resource data instance

Lib3MF_uint64 GetResourceDataCount()

Gets the number of resource data in the keysore

Returns:

The number of resource data available

PResourceData GetResourceData(const Lib3MF_uint64 nResourceDataIndex)

Gets a resource data

Parameters:

nResourceDataIndex – The index of the resource data

Returns:

The data resource instance

std::string GetUUID(bool &bHasUUID)

Gets the keystore UUID

Parameters:

bHasUUID – flag whether the keystore has a UUID

Returns:

returns the keystore uuid.

void SetUUID(const std::string &sUUID)

Sets the keystore UUID

Parameters:

sUUID – The new keystore uuid.

typedef std::shared_ptr<CKeyStore> Lib3MF::PKeyStore

Shared pointer to CKeyStore to easily allow reference counting.