Module: PKIFCryptoPPUtils
Definition in file PKIFCryptoPPUtils.h.
#include "PKIFdll.h"
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 __PKIFCRYPTOPPUTILS_H__ |
Definition at line 10 of file PKIFCryptoPPUtils.h.
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
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.
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
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.
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.
CPKIFException(COMMON_INVALID_INPUT) |
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 | ) |