ファイル情報

Rev. 4
サイズ 887 バイト
日時 2007-01-28 04:41:03
作者 seraphy
ログメッセージ

version 1.0_d20060207

内容

#pragma once

#include <Wincrypt.h>
#include <atlbase.h>

class DigestContext
{
	friend class Digest;

	DigestContext(const DigestContext& other) throw(); //<! 実装なし
	DigestContext& operator=(const DigestContext& other) throw(); //<! 実装なし

public:
	DigestContext() throw();
	~DigestContext() throw();

	BOOL Create() throw();

protected:
	HCRYPTPROV hProv_;
};

class Digest
{
	Digest(const Digest&); //<! 実装なし
	Digest& operator=(const Digest&); //<! 実装なし

public:
	Digest(DigestContext& ctx) throw ();
	~Digest() throw();

	BOOL Create(const ALG_ID algo_id) throw();

	BOOL Update(LPBYTE data, DWORD len) throw();

	size_t GetHashSize() throw();

	BOOL GetHashValue(LPBYTE data, DWORD len) throw();

private:
	DigestContext& ctx_;

	HCRYPTHASH hHash_;
};

BOOL CalcFileDigest(const LPCWSTR fileName, Digest& digest) throw();
旧リポジトリブラウザで表示