summaryrefslogtreecommitdiff
path: root/src/libstrongswan/credentials/certificates/certificate.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/libstrongswan/credentials/certificates/certificate.h')
-rw-r--r--src/libstrongswan/credentials/certificates/certificate.h26
1 files changed, 16 insertions, 10 deletions
diff --git a/src/libstrongswan/credentials/certificates/certificate.h b/src/libstrongswan/credentials/certificates/certificate.h
index a4f9aa3e0..43bfe3dc1 100644
--- a/src/libstrongswan/credentials/certificates/certificate.h
+++ b/src/libstrongswan/credentials/certificates/certificate.h
@@ -28,6 +28,7 @@ typedef enum cert_validation_t cert_validation_t;
#include <library.h>
#include <utils/identification.h>
#include <credentials/keys/public_key.h>
+#include <credentials/cred_encoding.h>
/**
* Kind of a certificate_t
@@ -163,18 +164,14 @@ struct certificate_t {
time_t *not_before, time_t *not_after);
/**
- * Is this newer than that?
+ * Get the certificate in an encoded form as a chunk.
*
- * @return TRUE if newer, FALSE otherwise
+ * @param type type of the encoding, one of CERT_*
+ * @param encoding encoding of the key, allocated
+ * @return TRUE if encoding supported
*/
- bool (*is_newer)(certificate_t *this, certificate_t *that);
-
- /**
- * Get the certificate in an encoded form.
- *
- * @return allocated chunk of encoded cert
- */
- chunk_t (*get_encoding)(certificate_t *this);
+ bool (*get_encoding)(certificate_t *this, cred_encoding_type_t type,
+ chunk_t *encoding);
/**
* Check if two certificates are equal.
@@ -197,4 +194,13 @@ struct certificate_t {
void (*destroy)(certificate_t *this);
};
+/**
+ * Generic check if a given certificate is newer than another.
+ *
+ * @param this first certificate to check
+ * @param other second certificate
+ * @return TRUE if this newer than other
+ */
+bool certificate_is_newer(certificate_t *this, certificate_t *other);
+
#endif /** CERTIFICATE_H_ @}*/