#include <Digest.h>
Public Member Functions | |
| Digest () | |
| ~Digest () | |
| bool | create (const std::string &name) |
| const std::string & | name () |
| bool | update (const char *bytes, size_t len) |
| std::string | digest () |
Static Public Member Functions | |
| static std::string | digest (const std::string &name, std::istream &is, size_t bufsize=4096) |
Private Member Functions | |
| Digest (const Digest &d) | |
| const Digest & | operator= (const Digest &d) |
Private Attributes | |
| P * | _dp |
Classes | |
| class | P |
Definition at line 44 of file Digest.h.
| zypp::Digest::Digest | ( | const Digest & | d | ) | [private] |
| bool zypp::Digest::create | ( | const std::string & | name | ) |
initialize creation of a new message digest Since openssl is used as backend you may use anything that openssl supports (see man 1 dgst). Common examples are md5 or sha1. sha1 should be preferred when creating digests to verify the authenticity of something.
successive calls to this funcion will destroy the internal state and reinit from scratch
| name | name of the message digest algorithm. |
Definition at line 126 of file Digest.cc.
References _dp, zypp::Digest::P::cleanup(), zypp::Digest::P::initialized, zypp::Digest::P::maybeInit(), and zypp::Digest::P::name.
Referenced by digest().
| const std::string & zypp::Digest::name | ( | ) |
get the name of the current digest algorithm
Definition at line 138 of file Digest.cc.
References _dp, and zypp::Digest::P::name.
| bool zypp::Digest::update | ( | const char * | bytes, | |
| size_t | len | |||
| ) |
feed data into digest computation algorithm
| bytes | ||
| len |
Definition at line 167 of file Digest.cc.
References _dp, zypp::Digest::P::cleanup(), zypp::Digest::P::finalized, zypp::Digest::P::maybeInit(), and zypp::Digest::P::mdctx.
Referenced by digest().
| std::string zypp::Digest::digest | ( | ) |
get hex string representation of the digest this function will finalize the digest computation. calls to update after this function will start from scratch
Definition at line 143 of file Digest.cc.
References _dp, zypp::Digest::P::finalized, zypp::Digest::P::maybeInit(), zypp::Digest::P::md_len, zypp::Digest::P::md_value, and zypp::Digest::P::mdctx.
Referenced by zypp::filesystem::checksum(), zypp::CheckSum::CheckSum(), digest(), zypp::storage::XMLFilesBackend::fileNameForNVR(), zypp::storage::XMLFilesBackend::fullPathForNamedFlags(), and zypp::filesystem::md5sum().
| std::string zypp::Digest::digest | ( | const std::string & | name, | |
| std::istream & | is, | |||
| size_t | bufsize = 4096 | |||
| ) | [static] |
compute digest of a stream. convenience function
calls create, update and digest in one function. The data for the computation is read from the stream
| name | name of the digest algorithm, |
| is | an input stream to get the data from | |
| bufsize | size of the buffer used for update(). Be careful, this is on the stack. |
P* zypp::Digest::_dp [private] |
1.5.3