# Poco

# namespace Crypto

## Overview

Classes: Cipher, CipherFactory, CipherImpl, CipherKey, CipherKeyImpl, CryptoException, CryptoIOS, CryptoInputStream, CryptoOutputStream, CryptoStreamBuf, CryptoTransform, DecryptingInputStream, DecryptingOutputStream, DigestEngine, ECDSADigestEngine, ECDSASignature, ECKey, ECKeyImpl, EVPCipherImpl, EVPPKey, EncryptingInputStream, EncryptingOutputStream, Envelope, KeyPair, KeyPairImpl, OpenSSLException, OpenSSLInitializer, PKCS12Container, RSACipherImpl, RSADigestEngine, RSAKey, RSAKeyImpl, X509Certificate

Functions: getError, initializeCrypto, uninitializeCrypto

## Classes

### class Cipher

Represents the abstract base class from which all implementations of symmetric/asymmetric encryption algorithms must inherit.

### class CipherFactory

A factory for Cipher objects.

### class CipherImpl

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

### class CipherKey

CipherKey stores the key information for decryption/encryption of data.

### class CipherKeyImpl

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

### class CryptoException

### class CryptoIOS

The base class for CryptoInputStream and CryptoOutputStream.

### class CryptoInputStream

This stream transforms all data passing through it using the given CryptoTransform.

### class CryptoOutputStream

This stream transforms all data passing through it using the given CryptoTransform.

### class CryptoStreamBuf

This stream buffer performs cryptographic transformation on the data going through it.

### class CryptoTransform

This interface represents the basic operations for cryptographic transformations to be used with a CryptoInputStream or a CryptoOutputStream.

### class DecryptingInputStream

This stream decrypts all data passing through it using the given Cipher.

### class DecryptingOutputStream

This stream decrypts all data passing through it using the given Cipher.

### class DigestEngine

This class implements a Poco::DigestEngine for all digest algorithms supported by OpenSSL.

### class ECDSADigestEngine

This class implements a Poco::DigestEngine that can be used to compute a secure digital signature.

### class ECDSASignature

A helper class for dealing with ECDSA signatures.

### class ECKey

This class stores an EC key pair, consisting of private and public key.

### class ECKeyImpl

Elliptic Curve key clas implementation.

### class EVPCipherImpl

An implementation of the Cipher class for asymmetric (public-private key) encryption based on the OpenSSL crypto library.

### class EVPPKey

Utility class for conversion of native keys to EVP.

### class EncryptingInputStream

This stream encrypts all data passing through it using the given Cipher.

### class EncryptingOutputStream

This stream encrypts all data passing through it using the given Cipher.

### class Envelope

Envelope encrypts/decrypts data using a symmetric key.

### class KeyPair

This is a parent class for classes storing a key pair, consisting of private and public key.

### class KeyPairImpl

Class KeyPairImpl

### class OpenSSLException

### class OpenSSLInitializer

Initalizes the OpenSSL library.

### class PKCS12Container

This class implements PKCS#12 container functionality.

### class RSACipherImpl

An implementation of the Cipher class for asymmetric (public-private key) encryption based on the the RSA algorithm in OpenSSL's crypto library.

### class RSADigestEngine

This class implements a Poco::DigestEngine that can be used to compute a secure digital signature.

### class RSAKey

This class stores an RSA key pair, consisting of private and public key.

### class RSAKeyImpl

class RSAKeyImpl

### class X509Certificate

This class represents a X509 Certificate.

## Functions

### getError

inline std::string & getError(
std::string & msg
);

Appends OpenSSL error(s) to msg and returns the augmented error description.

### initializeCrypto

void initializeCrypto();

Initialize the Crypto library, as well as the underlying OpenSSL libraries, by calling OpenSSLInitializer::initialize().

Should be called before using any class from the Crypto library. The Crypto library will be initialized automatically, through OpenSSLInitializer instances held by various Crypto classes (Cipher, CipherKey, RSAKey, X509Certificate). However, it is recommended to call initializeCrypto() in any case at application startup.

Can be called multiple times; however, for every call to initializeCrypto(), a matching call to uninitializeCrypto() must be performed.

### uninitializeCrypto

void uninitializeCrypto();

Uninitializes the Crypto library by calling OpenSSLInitializer::uninitialize().