make use of the pem helper plugin to load credentials

This commit is contained in:
Martin Willi
2009-08-26 11:23:49 +02:00
parent c9db16b7dd
commit 280469923d
11 changed files with 94 additions and 245 deletions
-21
View File
@@ -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;
}
-9
View File
@@ -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_ @}*/