gnutls_pubkey_set_pin_function: Added
gnutls_x509_privkey_import2: Added
gnutls_x509_privkey_import_openssl: Added
+gnutls_x509_crt_set_pin_function: Added
gnutls_load_file: Added
gnutls_pkcs12_simple_parse: Added
gnutls_certificate_set_x509_system_trust: Added
gnutls_assert ();
return ret;
}
+
+ if (key->pin.cb)
+ gnutls_pkcs11_privkey_set_pin_function(pkey, key->pin.cb, key->pin.data);
ret = gnutls_pkcs11_privkey_import_url (pkey, url, 0);
if (ret < 0)
int gnutls_x509_crt_get_issuer_unique_id (gnutls_x509_crt_t crt, char *buf,
size_t * buf_size);
+ void gnutls_x509_crt_set_pin_function (gnutls_x509_crt_t crt,
+ gnutls_pin_callback_t fn, void *userdata);
+
/**
* gnutls_info_access_what_t:
* @GNUTLS_IA_ACCESSMETHOD_OID: Get accessMethod OID.
gnutls_pkcs11_obj_set_pin_function;
gnutls_pkcs11_privkey_set_pin_function;
gnutls_certificate_set_pin_function;
+ gnutls_x509_crt_set_pin_function;
} GNUTLS_3_0_0;
GNUTLS_PRIVATE {
gnutls_assert ();
return ret;
}
+
+ if (crt->pin.cb)
+ gnutls_pkcs11_obj_set_pin_function (pcrt, crt->pin.cb, crt->pin.data);
ret = gnutls_pkcs11_obj_import_url (pcrt, url, flags);
if (ret < 0)
return ret;
}
-
/**
* gnutls_x509_crt_import_pkcs11:
* @crt: A certificate of type #gnutls_x509_crt_t
return ret;
}
+
+/**
+ * gnutls_x509_crt_set_pin_function:
+ * @crt: The certificate structure
+ * @fn: the callback
+ * @userdata: data associated with the callback
+ *
+ * This function will set a callback function to be used when
+ * it is required to access a protected object. This function overrides
+ * the global function set using gnutls_pkcs11_set_pin_function().
+ *
+ * Note that this callback is currently used only during the import
+ * of a PKCS #11 certificate with gnutls_x509_crt_import_pkcs11_url().
+ *
+ * Since: 3.1.0
+ *
+ **/
+void gnutls_x509_crt_set_pin_function (gnutls_x509_crt_t crt,
+ gnutls_pin_callback_t fn, void *userdata)
+{
+ crt->pin.cb = fn;
+ crt->pin.data = userdata;
+}
{
ASN1_TYPE cert;
int use_extensions;
+
+ struct pin_info_st pin;
} gnutls_x509_crt_int;
typedef struct gnutls_x509_crq_int