Botan  1.11.15
src/lib/pubkey/keypair/keypair.h
Go to the documentation of this file.
00001 /*
00002 * Keypair Checks
00003 * (C) 1999-2010 Jack Lloyd
00004 *
00005 * Botan is released under the Simplified BSD License (see license.txt)
00006 */
00007 
00008 #ifndef BOTAN_KEYPAIR_CHECKS_H__
00009 #define BOTAN_KEYPAIR_CHECKS_H__
00010 
00011 #include <botan/pk_keys.h>
00012 
00013 namespace Botan {
00014 
00015 namespace KeyPair {
00016 
00017 /**
00018 * Tests whether the key is consistent for encryption; whether
00019 * encrypting and then decrypting gives to the original plaintext.
00020 * @param rng the rng to use
00021 * @param key the key to test
00022 * @param padding the encryption padding method to use
00023 * @return true if consistent otherwise false
00024 */
00025 BOTAN_DLL bool
00026 encryption_consistency_check(RandomNumberGenerator& rng,
00027                              const Private_Key& key,
00028                              const std::string& padding);
00029 
00030 /**
00031 * Tests whether the key is consistent for signatures; whether a
00032 * signature can be created and then verified
00033 * @param rng the rng to use
00034 * @param key the key to test
00035 * @param padding the signature padding method to use
00036 * @return true if consistent otherwise false
00037 */
00038 BOTAN_DLL bool
00039 signature_consistency_check(RandomNumberGenerator& rng,
00040                             const Private_Key& key,
00041                             const std::string& padding);
00042 
00043 }
00044 
00045 }
00046 
00047 #endif