diff options
author | lloyd <[email protected]> | 2012-07-27 17:30:13 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2012-07-27 17:30:13 +0000 |
commit | 4d0008edca9d3c0a119518e7d9b49c81d7dbe33c (patch) | |
tree | c359b14f9f0a0a495fea6eb241cb082fd0dc0717 /src/pubkey/pk_keys.h | |
parent | 16ccb3c130ad29aee2e640d498606314ac486f55 (diff) |
Add Public_Key::estimated_strength which gives an approximation of how
hard that key is to break.
Use it in cert path validation, rejecting keys with estimated strength
less than 80 bits.
Diffstat (limited to 'src/pubkey/pk_keys.h')
-rw-r--r-- | src/pubkey/pk_keys.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/pubkey/pk_keys.h b/src/pubkey/pk_keys.h index a3b693956..a8585c154 100644 --- a/src/pubkey/pk_keys.h +++ b/src/pubkey/pk_keys.h @@ -28,6 +28,17 @@ class BOTAN_DLL Public_Key virtual std::string algo_name() const = 0; /** + * Return the estimated strength of the underlying key against + * the best currently known attack. Note that this ignores anything + * but pure attacks against the key itself and do not take into + * account padding schemes, usage mistakes, etc which might reduce + * the strength. However it does suffice to provide an upper bound. + * + * @return estimated strength in bits + */ + virtual size_t estimated_strength() const = 0; + + /** * Get the OID of the underlying public key scheme. * @return OID of the public key scheme */ |