PKIFCNGCAPIRaw.cpp File Reference


Detailed Description

Subsystem: Cryptography (PKIFCRYPTO)

Module: CPKIFCNGCAPIRaw

Id
PKIFCNGCAPIRaw.cpp 10708 2009-10-14 19:21:21Z cwallace

Definition in file PKIFCNGCAPIRaw.cpp.

#include "PKIFCNGCAPIRaw.h"
#include "PKIFCAPICryptContext2.h"
#include "PKIFCAPIHashContext.h"
#include "CAPIUtils.h"
#include "PKIFCryptoException.h"
#include "PKIFKeyMaterial.h"
#include "PKIFCryptoErrors.h"
#include "PKIFCAPIErrors.h"
#include "CAPIRawCryptContext.h"
#include "Buffer.h"
#include "AlgorithmIdentifier.h"
#include "Certificate.h"
#include "ToolkitUtils.h"
#include "components.h"
#include "PKIFException.h"
#include "SubjectPublicKeyInfo.h"
#include "ASN1Helper.h"
#include "PKIX1Algorithms88.h"
#include <iostream>
#include <sstream>
#include "PKIFCNGUtils.h"
#include "PKIFBCryptPublicKey.h"
#include "dsa.h"
#include "boost/numeric/conversion/cast.hpp"

Include dependency graph for PKIFCNGCAPIRaw.cpp:

Go to the source code of this file.

Defines

#define STATUS_NOT_SUPPORTED   ((NTSTATUS)0xC00000BBL)
#define STATUS_BUFFER_TOO_SMALL   ((NTSTATUS)0xC0000023L)
#define NT_SUCCESS(Status)   (((NTSTATUS)(Status)) >= 0)
#define STATUS_UNSUCCESSFUL   ((NTSTATUS)0xC0000001L)

Functions

LPCWSTR GetCNGSymAlgorithm (const CPKIFKeyMaterial &key)
bool _CNGVerify (const CPKIFKeyMaterial &key, unsigned char *pHashData, int nHashDataLen, unsigned char *pSignature, int nSignatureLen, PKIFCRYPTO::HASH_ALG ha)


Define Documentation

#define NT_SUCCESS ( Status   )     (((NTSTATUS)(Status)) >= 0)

Definition at line 57 of file PKIFCNGCAPIRaw.cpp.

#define STATUS_BUFFER_TOO_SMALL   ((NTSTATUS)0xC0000023L)

Definition at line 52 of file PKIFCNGCAPIRaw.cpp.

#define STATUS_NOT_SUPPORTED   ((NTSTATUS)0xC00000BBL)

Definition at line 49 of file PKIFCNGCAPIRaw.cpp.

#define STATUS_UNSUCCESSFUL   ((NTSTATUS)0xC0000001L)

Definition at line 58 of file PKIFCNGCAPIRaw.cpp.


Function Documentation

bool _CNGVerify ( const CPKIFKeyMaterial key,
unsigned char *  pHashData,
int  nHashDataLen,
unsigned char *  pSignature,
int  nSignatureLen,
PKIFCRYPTO::HASH_ALG  ha 
)

Interface: Module

This is a helper function called in Verify

Returns:
This function returns true if the signature verifies and false otherwise. Some errors can result in exceptions
Exceptions:
CPKIFCryptoException(PKIFCAPI_CREATE_CERT_FAILED) 
CPKIFCryptoException(PKIFCAPI_ACQUIRE_CONTEXT_FAILED) 
CPKIFCryptoException(PKIFCAPI_KEY_IMPORT_FAILED) 
CPKIFCryptoException(PKIFCAPI_KEY_MATERIAL_NOT_SUPPORTED) 
Parameters:
key  [in] Reference to a CPKIFKeyMaterial object containing key material to use when verifying the signature
pHashData  [in] Pointer to a buffer containing the message digest that was signed to produce the signature conveyed via the pSignature parameter
nHashDataLen  [in] Integer indicating the length of the value passed via the pHashData parameter
pSignature  [in] Pointer to a buffer containing the signature to verify
nSignatureLen  [in] Integer indicating the size of the value passed via the pSignature parameter
ha  [in] Hash algorithm used with signature

Definition at line 480 of file PKIFCNGCAPIRaw.cpp.

References PKIFScopedArray< T >::clear(), CRYPTO_ALG_NOT_SUPPORTED, PKIFScopedArray< T >::get(), CPKIFBCryptPublicKey::Initialize(), LOG_STRING_DEBUG, NT_SUCCESS, RAISE_CRYPTO_EXCEPTION, PKIFScopedArray< T >::reset(), PKIFCRYPTO::SHA1, PKIFCRYPTO::SHA256, PKIFCRYPTO::SHA384, PKIFCRYPTO::SHA512, TOOLKIT_CRYPTO, and TOOLKIT_CRYPTO_CAPIRAW.

Referenced by CPKIFCNGCAPIRaw::Verify().

LPCWSTR GetCNGSymAlgorithm ( const CPKIFKeyMaterial key  ) 

Interface: Module

This function is used to retrive symmetric algorithm

Returns:
This function returns ALG_ID
Exceptions:
CPKIFCryptoException(CRYPTO_ALG_NOT_SUPPORTED) 
Parameters:
key  [in]CPKIFKeyMaterial object

Definition at line 163 of file PKIFCNGCAPIRaw.cpp.

References PKIFCRYPTO::AES, PKIFCRYPTO::AES128, PKIFCRYPTO::AES192, PKIFCRYPTO::AES256, CRYPTO_ALG_NOT_SUPPORTED, PKIFCRYPTO::DES, CPKIFKeyMaterial::GetSymmetricKeyAlgorithm(), RAISE_CRYPTO_EXCEPTION, PKIFCRYPTO::TDES, and TOOLKIT_CRYPTO.

Referenced by CPKIFCNGCAPIRaw::CryptInit(), and CPKIFCNGCAPIRaw::SupportsAlgorithm().


Generated on Mon Nov 15 11:18:11 2010 for PublicKeyInfrastructureFramework(PKIF) by  doxygen 1.5.6