Virgil Security Crypto library
1.8.2
|
Provides Password-Based Cryptography. Now PKCS#5 and PKCS#12 are partially supported. More...
#include <VirgilPBE.h>
Public Types | |
Constants | |
enum | { kIterationCountMin = 1024 } |
Public Member Functions | |
Constructor / Destructor | |
VirgilPBE () | |
Create object with undefined algorithm. More... | |
virtual | ~VirgilPBE () throw () |
Polymorphic destructor. | |
Encryption / Decryption | |
virgil::crypto::VirgilByteArray | encrypt (const virgil::crypto::VirgilByteArray &data, const virgil::crypto::VirgilByteArray &pwd) const |
Encrypt data with given password. More... | |
virgil::crypto::VirgilByteArray | decrypt (const virgil::crypto::VirgilByteArray &data, const virgil::crypto::VirgilByteArray &pwd) const |
Decrypt data with given password. More... | |
Copy constructor / assignment operator | |
| |
VirgilPBE (const VirgilPBE &other) | |
VirgilPBE & | operator= (const VirgilPBE &rhs) |
VirgilAsn1Compatible implementation | |
Marshalling format:
PBE ::= AlgorithmIdentifier {{ PBEAlgorithms }}
PBEAlgorithms AlgorithmIdentifier ::= {
{ OID id-PBES2 PARMS PBES2-params } |
{ OID pkcs-12PbeId PARMS pkcs-12PbeParams }
}
| |
virtual size_t | asn1Write (virgil::crypto::foundation::asn1::VirgilAsn1Writer &asn1Writer, size_t childWrittenBytes=0) const |
Write object state to the writer. More... | |
virtual void | asn1Read (virgil::crypto::foundation::asn1::VirgilAsn1Reader &asn1Reader) |
Read object state from the reader. More... | |
Public Member Functions inherited from virgil::crypto::foundation::asn1::VirgilAsn1Compatible | |
virgil::crypto::VirgilByteArray | toAsn1 () const |
Save object state to the ASN.1 structure. | |
void | fromAsn1 (const virgil::crypto::VirgilByteArray &asn1) |
Restore object state from the ASN.1 structure. | |
virtual | ~VirgilAsn1Compatible () throw () |
Polymorphic destructor. | |
Static Public Member Functions | |
Creation methods | |
Object creation with specific hash function. | |
static VirgilPBE | pkcs5 (const virgil::crypto::VirgilByteArray &salt, size_t iterationCount=kIterationCountMin) |
Create object with PKCS#5 parameters for PBE encryption or decryption. More... | |
static VirgilPBE | pkcs12 (const virgil::crypto::VirgilByteArray &salt, size_t iterationCount=kIterationCountMin) |
Create object with PKCS#12 parameters for PBE encryption or decryption. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from virgil::crypto::foundation::asn1::VirgilAsn1Compatible | |
virtual void | checkAsn1ParamNotEmpty (const virgil::crypto::VirgilByteArray ¶m, const char *paramName=0) const |
If given parameter is empty exception will be thrown. More... | |
Provides Password-Based Cryptography. Now PKCS#5 and PKCS#12 are partially supported.
virgil::crypto::foundation::VirgilPBE::VirgilPBE | ( | ) |
Create object with undefined algorithm.
|
virtual |
Read object state from the reader.
asn1Reader | reader payloaded with ASN.1 to be read. |
Implements virgil::crypto::foundation::asn1::VirgilAsn1Compatible.
|
virtual |
Write object state to the writer.
asn1Writer | writer that should be payloaded by subclasses. |
childWrittenBytes | count of bytes that was written by subclasses. |
Implements virgil::crypto::foundation::asn1::VirgilAsn1Compatible.
virgil::crypto::VirgilByteArray virgil::crypto::foundation::VirgilPBE::decrypt | ( | const virgil::crypto::VirgilByteArray & | data, |
const virgil::crypto::VirgilByteArray & | pwd | ||
) | const |
Decrypt data with given password.
data | - data to decrypt. |
pwd | - password to use for decryption (max length is 31 byte). |
virgil::crypto::VirgilByteArray virgil::crypto::foundation::VirgilPBE::encrypt | ( | const virgil::crypto::VirgilByteArray & | data, |
const virgil::crypto::VirgilByteArray & | pwd | ||
) | const |
Encrypt data with given password.
data | - data to encrypt. |
pwd | - password to use for encryption (max length is 31 byte). |
|
static |
Create object with PKCS#12 parameters for PBE encryption or decryption.
|
static |
Create object with PKCS#5 parameters for PBE encryption or decryption.