# Poco::Crypto

# class CipherFactory

Library: Crypto
Package: Cipher
Header: Poco/Crypto/CipherFactory.h

## Description

A factory for Cipher objects. See the Cipher class for examples on how to use the CipherFactory.

## Member Summary

Member Functions: createCipher, defaultFactory

## Constructors

### CipherFactory

CipherFactory();

Creates a new CipherFactory object.

## Destructor

### ~CipherFactory

virtual ~CipherFactory();

Destroys the CipherFactory.

## Member Functions

### createCipher

Cipher * createCipher(
const CipherKey & key
);

Creates a Cipher object for the given Cipher name. Valid cipher names depend on the OpenSSL version the library is linked with; see the output of

    openssl enc --help

for a list of supported block and stream ciphers.

Common examples are:

- AES: "aes-128", "aes-256"
- DES: "des", "des3"
- Blowfish: "bf"

### createCipher

Cipher * createCipher(
const RSAKey & key,
RSAPaddingMode paddingMode = RSA_PADDING_PKCS1
);

Creates a RSACipher using the given RSA key and padding mode for public key encryption/private key decryption.

### defaultFactory

static CipherFactory & defaultFactory();

Returns the default CipherFactory.