make use of the pem helper plugin to load credentials
This commit is contained in:
@@ -1066,24 +1066,3 @@ pkcs7_t *pkcs7_create_from_data(chunk_t data)
|
||||
return &this->public;
|
||||
}
|
||||
|
||||
/*
|
||||
* Described in header.
|
||||
*/
|
||||
pkcs7_t *pkcs7_create_from_file(const char *filename, const char *label)
|
||||
{
|
||||
bool pgp = FALSE;
|
||||
chunk_t chunk = chunk_empty;
|
||||
char cert_label[BUF_LEN];
|
||||
pkcs7_t *pkcs7;
|
||||
|
||||
snprintf(cert_label, BUF_LEN, "%s pkcs7", label);
|
||||
|
||||
if (!pem_asn1_load_file(filename, NULL, cert_label, &chunk, &pgp))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
pkcs7 = pkcs7_create_from_chunk(chunk, 0);
|
||||
free(chunk.ptr);
|
||||
return pkcs7;
|
||||
}
|
||||
|
||||
@@ -166,13 +166,4 @@ pkcs7_t *pkcs7_create_from_chunk(chunk_t chunk, u_int level);
|
||||
*/
|
||||
pkcs7_t *pkcs7_create_from_data(chunk_t data);
|
||||
|
||||
/**
|
||||
* Read a X.509 certificate from a DER encoded file.
|
||||
*
|
||||
* @param filename file containing DER encoded data
|
||||
* @param label label describing kind of PKCS#7 file
|
||||
* @return created pkcs7_t object, or NULL if invalid.
|
||||
*/
|
||||
pkcs7_t *pkcs7_create_from_file(const char *filename, const char *label);
|
||||
|
||||
#endif /** PKCS7_H_ @}*/
|
||||
|
||||
Reference in New Issue
Block a user