- this->public.interface.get_type = (certificate_type_t (*)(certificate_t *this))get_type;
- this->public.interface.get_subject = (identification_t* (*)(certificate_t *this))get_subject;
- this->public.interface.get_issuer = (identification_t* (*)(certificate_t *this))get_issuer;
- this->public.interface.has_subject = (id_match_t (*)(certificate_t*, identification_t *subject))has_subject;
- this->public.interface.has_issuer = (id_match_t (*)(certificate_t*, identification_t *issuer))has_issuer;
- this->public.interface.issued_by = (bool (*)(certificate_t *this, certificate_t *issuer))issued_by;
- this->public.interface.get_public_key = (public_key_t* (*)(certificate_t *this))get_public_key;
- this->public.interface.get_validity = (bool (*)(certificate_t*, time_t *when, time_t *, time_t*))get_validity;
- this->public.interface.get_encoding = (bool (*)(certificate_t*,cred_encoding_type_t,chunk_t*))get_encoding;
- this->public.interface.equals = (bool (*)(certificate_t*, certificate_t *other))equals;
- this->public.interface.get_ref = (certificate_t* (*)(certificate_t *this))get_ref;
- this->public.interface.destroy = (void (*)(certificate_t *this))destroy;
+ INIT(this,
+ .public = {
+ .interface = {
+ .get_type = _get_type,
+ .get_subject = _get_subject,
+ .get_issuer = _get_issuer,
+ .has_subject = _has_subject,
+ .has_issuer = _has_issuer,
+ .issued_by = _issued_by,
+ .get_public_key = _get_public_key,
+ .get_validity = _get_validity,
+ .get_encoding = _get_encoding,
+ .equals = _equals,
+ .get_ref = _get_ref,
+ .destroy = _destroy,
+ },
+ },
+ .ref = 1,
+ .key = key,
+ .issuer = identification_create_from_encoding(ID_ANY, chunk_empty),
+ );