PKIFCryptoPPUtils.h File Reference


Detailed Description

Subsystem: Cryptography (PKIFCRYPTO)

Module: PKIFCryptoPPUtils

Id
PKIFCryptoPPUtils.h 9903 2009-05-13 13:02:22Z agalustyan

Definition in file PKIFCryptoPPUtils.h.

#include "PKIFdll.h"

Include dependency graph for PKIFCryptoPPUtils.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define __PKIFCRYPTOPPUTILS_H__

Functions

 FD_SMART_PTR (CPKIFCredential)
 FD_SMART_PTR (CPKIFKeyMaterial)
 FD_SMART_PTR (CPKIFCertificate)
 FD_SMART_PTR (CPKIFBuffer)
CAC_API CPKIFBufferPtr GetTBSCertSequence (const CPKIFCertificate &cert)
CAC_API CPKIFCredentialPtr MakeCredentialFromP8File (const std::string &file)
CAC_API CPKIFCredentialPtr MakeCredentialFromP8File (const std::string &file, const std::string &certFile)
CAC_API CPKIFKeyMaterialPtr MakeKeyMaterialFromPKFile (const std::string &file)
CAC_API CPKIFKeyMaterialPtr MakeKeyMaterialFromP8File (const std::string &file)
CAC_API CPKIFBufferPtr GetEncodedSPKIFromKM (const CPKIFKeyMaterial &km)
CAC_API CPKIFBufferPtr DeriveKeyFromSecret (const CPKIFBufferPtr &secret, const CPKIFBufferPtr &sharedInfo, unsigned int keyLength)


Define Documentation

#define __PKIFCRYPTOPPUTILS_H__

Definition at line 10 of file PKIFCryptoPPUtils.h.


Function Documentation

CAC_API CPKIFBufferPtr DeriveKeyFromSecret ( const CPKIFBufferPtr &  secret,
const CPKIFBufferPtr &  sharedInfo,
unsigned int  keyLength 
)

Interface: External

Derives a symmetric key from secret and non-secret data.

If length is 0, sharedInfo must be a DER-encoded ECC CMS Shared Info buffer

Returns:
a buffer containing a secret key
Parameters:
secret  [in] shared secret from a key agreement operation
sharedInfo  [in] shared info to append to the hashed data
keyLength  [in] length of the key to derive. If keyLength is 0, sharedInfo must be an ECC CMS SharedInfo structure

Definition at line 283 of file PKIFCryptoPPUtils.cpp.

References CACASNWRAPPER_CREATE, COMMON_INVALID_INPUT, PKIFCRYPTO::SHA256, PKIFCRYPTO::SHA384, and TOOLKIT_CRYPTO.

FD_SMART_PTR ( CPKIFBuffer   ) 

FD_SMART_PTR ( CPKIFCertificate   ) 

FD_SMART_PTR ( CPKIFKeyMaterial   ) 

FD_SMART_PTR ( CPKIFCredential   ) 

CAC_API CPKIFBufferPtr GetEncodedSPKIFromKM ( const CPKIFKeyMaterial km  ) 

Interface: External

Returns an encoded SubjectPublicKeyInfo structure from a Key Material object if possible.

Returns:
CPKIFBuffer object

Definition at line 267 of file PKIFCryptoPPUtils.cpp.

CAC_API CPKIFBufferPtr GetTBSCertSequence ( const CPKIFCertificate cert  ) 

These are a few utility functions to make geting key material into and out of crypto++ less cumbersome

Interface: External

Pulls the der-encoded tbsCertificate out of a certificate object for easy signature verification

Returns:
Buffer containing der-encoded tbsCertificate sequence
Parameters:
cert  [in] PKIF certificate object from which the encoded sequence will be taken

Definition at line 76 of file PKIFCryptoPPUtils.cpp.

References COMMON_INVALID_INPUT, CPKIFCertificate::Encoded(), and TOOLKIT_CRYPTO.

Referenced by CPKIFCryptoPPRaw::VerifyCertificate(), and VerifyCertificateWithCryptoPP().

CAC_API CPKIFCredentialPtr MakeCredentialFromP8File ( const std::string &  file,
const std::string &  certFile 
)

Interface: External

Creates a Crypto++ Credential given a file. Handle with care, the file and the credential will contain plaintext key material. This will throw if it can't read the file and return an empty credential if the file is readable but invalid.

Returns:
PKIFCryptoPPCredential object
Exceptions:
CPKIFException(COMMON_INVALID_INPUT) 

Definition at line 223 of file PKIFCryptoPPUtils.cpp.

References _MakeCredentialFromP8File(), PEMDecode_l(), and ReadFileIntoBuffer().

CAC_API CPKIFCredentialPtr MakeCredentialFromP8File ( const std::string &  file  ) 

Interface: External

Creates a Crypto++ Credential given a file. Handle with care, the file and the credential will contain plaintext key material. This will throw if it can't read the file and return an empty credential if the file is readable but invalid.

Returns:
PKIFCryptoPPCredential object
Exceptions:
CPKIFException(COMMON_INVALID_INPUT) 
Parameters:
file  [in] string containg the location of the PKCS 8 file

Definition at line 206 of file PKIFCryptoPPUtils.cpp.

References _MakeCredentialFromP8File().

CAC_API CPKIFKeyMaterialPtr MakeKeyMaterialFromP8File ( const std::string &  file  ) 

CAC_API CPKIFKeyMaterialPtr MakeKeyMaterialFromPKFile ( const std::string &  file  ) 


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