Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

OW32::CCryptKey Class Reference

CryptoAPI keywrapper. More...

#include <CryptKey.h>

List of all members.

Public Member Functions

 CCryptKey ()
 Constructs an empty key object.
 CCryptKey (HCRYPTKEY hCryptKey)
 Constructs an key object, taking control of an existing key handle.
void Destroy ()
 Destroy the key object, if created.
BOOL Gen (HCRYPTPROV hProv, ALG_ID AlgId, DWORD dwFlags=0)
 Generate a new key.
BOOL Derive (HCRYPTPROV hProv, ALG_ID AlgId, HCRYPTHASH hBaseData, DWORD dwFlags=0)
 Derive a key from a hash.
BOOL Import (HCRYPTPROV hProv, BYTE *pbData, DWORD dwDataLen, HCRYPTKEY hPubKey=0, DWORD dwFlags=0)
 Import a key object from existing data.
BOOL Decrypt (BYTE *pbData, DWORD *cbData, BOOL bFinal=TRUE, HCRYPTHASH hHash=NULL, DWORD dwFlags=0)
 Decrypt data with the given key.
BOOL Encrypt (BYTE *pbData, DWORD *cbData, DWORD cbBuf, BOOL bFinal=TRUE, HCRYPTHASH hHash=NULL, DWORD dwFlags=0)
 Encrypt data with the given key.


Detailed Description

CryptoAPI keywrapper.


Member Function Documentation

BOOL OW32::CCryptKey::Decrypt BYTE *  pbData,
DWORD *  cbData,
BOOL  bFinal = TRUE,
HCRYPTHASH  hHash = NULL,
DWORD  dwFlags = 0
[inline]
 

Decrypt data with the given key.

Returns:
TRUE if successful, FALSE if not
Parameters:
pbData The data to decrypt (in/out)
cbData The length of the data to decrypt (in/out)
bFinal TRUE if this is the final block, FALSE if not.
hHash Handle of hash object if hashing at the same time, NULL if not.
dwFlags Flags, if any

BOOL OW32::CCryptKey::Derive HCRYPTPROV  hProv,
ALG_ID  AlgId,
HCRYPTHASH  hBaseData,
DWORD  dwFlags = 0
[inline]
 

Derive a key from a hash.

Returns:
TRUE if successful, FALSE if not.
Parameters:
hProv The cryptographic service provider to use.
algId The key algorithm
hBaseData The base data
dwFlags Optional flags for CryptDeriveKey

BOOL OW32::CCryptKey::Encrypt BYTE *  pbData,
DWORD *  cbData,
DWORD  cbBuf,
BOOL  bFinal = TRUE,
HCRYPTHASH  hHash = NULL,
DWORD  dwFlags = 0
[inline]
 

Encrypt data with the given key.

Returns:
TRUE if successful, FALSE if not
Parameters:
pbData The data to encrypt (in/out)
cbData The length of the data to encrypt (in/out)
cbBuf The length of the data buffer (may need to be larger than input data for block ciphers)
bFinal TRUE if this is the final block, FALSE if not.
hHash Handle of hash object if hashing at the same time, NULL if not.
dwFlags Flags, if any

BOOL OW32::CCryptKey::Gen HCRYPTPROV  hProv,
ALG_ID  AlgId,
DWORD  dwFlags = 0
[inline]
 

Generate a new key.

Returns:
TRUE if successful, FALSE if not.
Parameters:
hProv The cryptographic service provider to use.
algId The key algorithm
dwFlags Optional flags for CryptCreateKey

BOOL OW32::CCryptKey::Import HCRYPTPROV  hProv,
BYTE *  pbData,
DWORD  dwDataLen,
HCRYPTKEY  hPubKey = 0,
DWORD  dwFlags = 0
[inline]
 

Import a key object from existing data.

Returns:
TRUE if successful, FALSE if not.
Parameters:
hProv The cryptographic service provider to use.
pbData The key data
dwDataLen The length of the key data
hPubKey The public key to decrypt the key data with
dwFlags Optional flags for CryptImportKey


The documentation for this class was generated from the following file:
Generated on Sun Jun 5 01:29:23 2005 for OW32 by  doxygen 1.3.9.1