Poco::Crypto

class CipherKeyImpl

Library: Crypto
Package: CryptoCore
Header: Poco/Crypto/CipherKeyImpl.h

Description

An implementation of the Cipher class for OpenSSL's crypto library.

Inheritance

Direct Base Classes: Poco::RefCountedObject

All Base Classes: Poco::RefCountedObject

Member Summary

Member Functions: blockSize, cipher, getIV, getKey, ivSize, keySize, mode, name, setIV, setKey

Inherited Functions: duplicate, referenceCount, release

Types

ByteVec

typedef std::vector < unsigned char > ByteVec;

Ptr

typedef Poco::AutoPtr < CipherKeyImpl > Ptr;

Enumerations

Mode

Cipher mode of operation. This mode determines how multiple blocks are connected; this is essential to improve security.

MODE_STREAM_CIPHER

Stream cipher

MODE_ECB

Electronic codebook (plain concatenation)

MODE_CBC

Cipher block chaining (default)

MODE_CFB

Cipher feedback

MODE_OFB

Output feedback

Constructors

CipherKeyImpl

CipherKeyImpl(
    const std::string & name
);

Creates a new CipherKeyImpl object. Autoinitializes key and iv

CipherKeyImpl

CipherKeyImpl(
    const std::string & name,
    const ByteVec & key,
    const ByteVec & iv
);

Creates a new CipherKeyImpl object

CipherKeyImpl

CipherKeyImpl(
    const std::string & name,
    const std::string & passphrase,
    const std::string & salt,
    int iterationCount
);

Creates a new CipherKeyImpl object

Destructor

~CipherKeyImpl virtual

virtual ~CipherKeyImpl();

Destroys the CipherKeyImpl.

Member Functions

blockSize

int blockSize() const;

Returns the block size of the Cipher.

cipher inline

const EVP_CIPHER * cipher();

Returns the cipher object

getIV inline

const ByteVec & getIV() const;

Returns the initialization vector (IV) for the Cipher.

getKey inline

const ByteVec & getKey() const;

Returns the key for the Cipher.

ivSize

int ivSize() const;

Returns the IV size of the Cipher.

keySize

int keySize() const;

Returns the key size of the Cipher.

mode

Mode mode() const;

Returns the Cipher's mode of operation.

name inline

const std::string & name() const;

Returns the name of the Cipher.

setIV inline

void setIV(
    const ByteVec & iv
);

Sets the initialization vector (IV) for the Cipher.

setKey inline

void setKey(
    const ByteVec & key
);

Sets the key for the Cipher.