Commit 7ce25540 authored by Stef Walter's avatar Stef Walter

[pkcs11] Change terminology from 'authenticator' to 'credential.

Change the CKO_G_AUTHENTICATOR to CKO_G_CREDENTIAL and
GckAuthenticator to GckCredential. Fine tune other
related naming conventions.
parent e0773b73
......@@ -108,7 +108,7 @@ authenticate_collection (GkdSecretsUnlock *self, GP11Object *coll, gboolean *loc
GError *error = NULL;
GP11Attributes *attrs;
GP11Session *session;
GP11Object *auth;
GP11Object *cred;
gchar *password;
gsize n_password;
......@@ -138,9 +138,9 @@ authenticate_collection (GkdSecretsUnlock *self, GP11Object *coll, gboolean *loc
password = gkd_prompt_get_password (GKD_PROMPT (self), "password");
n_password = password ? strlen (password) : 0;
auth = gp11_session_create_object (session, &error,
CKA_CLASS, GP11_ULONG, CKO_GNOME_AUTHENTICATOR,
CKA_GNOME_OBJECT, GP11_ULONG, gp11_object_get_handle (coll),
cred = gp11_session_create_object (session, &error,
CKA_CLASS, GP11_ULONG, CKO_G_CREDENTIAL,
CKA_G_OBJECT, GP11_ULONG, gp11_object_get_handle (coll),
CKA_GNOME_TRANSIENT, GP11_BOOLEAN, TRUE,
CKA_TOKEN, GP11_BOOLEAN, FALSE,
CKA_VALUE, n_password, password,
......@@ -148,8 +148,8 @@ authenticate_collection (GkdSecretsUnlock *self, GP11Object *coll, gboolean *loc
egg_secure_strfree (password);
g_object_unref (session);
if (auth) {
g_object_unref (auth);
if (cred) {
g_object_unref (cred);
*locked = FALSE;
return TRUE; /* Operation succeeded, and unlocked */
......@@ -160,7 +160,7 @@ authenticate_collection (GkdSecretsUnlock *self, GP11Object *coll, gboolean *loc
return TRUE; /* Operation succeded, although not unlocked*/
} else {
g_warning ("couldn't create authenticator for collection: %s",
g_warning ("couldn't create credential for collection: %s",
error->message);
g_clear_error (&error);
return FALSE; /* Operation failed */
......
......@@ -69,7 +69,7 @@ auth_object_for_context_specific (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE obj
CK_BBOOL token, always;
CK_ULONG n_attrs;
CK_RV rv;
/* Lookup information about the specific object */
attrs[0].type = CKA_LABEL;
attrs[0].pValue = label = NULL;
......@@ -161,26 +161,26 @@ auth_object_for_context_specific (CK_SESSION_HANDLE handle, CK_OBJECT_HANDLE obj
}
static void
auth_create_authenticator (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object,
CK_UTF8CHAR_PTR pin, CK_ULONG n_pin)
auth_create_credential (CK_SESSION_HANDLE session, CK_OBJECT_HANDLE object,
CK_UTF8CHAR_PTR pin, CK_ULONG n_pin)
{
CK_OBJECT_CLASS klass = CKO_GNOME_AUTHENTICATOR;
CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
CK_BBOOL transient = CK_TRUE;
CK_BBOOL token = CK_FALSE;
CK_ATTRIBUTE attrs[] = {
{ CKA_CLASS, &klass, sizeof (klass) },
{ CKA_GNOME_OBJECT, &object, sizeof (object) },
{ CKA_G_OBJECT, &object, sizeof (object) },
{ CKA_GNOME_TRANSIENT, &transient, sizeof (transient) },
{ CKA_TOKEN, &token, sizeof (token) },
{ CKA_VALUE, pin, n_pin }
};
CK_OBJECT_HANDLE authenticator;
CK_OBJECT_HANDLE credential;
CK_RV rv;
rv = pkcs11_lower->C_CreateObject (session, attrs, G_N_ELEMENTS (attrs), &authenticator);
rv = pkcs11_lower->C_CreateObject (session, attrs, G_N_ELEMENTS (attrs), &credential);
if (rv != CKR_OK)
g_message ("failed to create authenticator object (code: %lu)", (gulong)rv);
g_message ("failed to create credential object (code: %lu)", (gulong)rv);
}
/* --------------------------------------------------------------------------------------
......@@ -530,7 +530,7 @@ auth_C_Login (CK_SESSION_HANDLE handle, CK_USER_TYPE user_type,
/* If that was successful, then we can create an authenticator object */
if (user_type == CKU_CONTEXT_SPECIFIC && rv == CKR_OK && object != 0)
auth_create_authenticator (handle, object, pin, pin_len);
auth_create_credential (handle, object, pin, pin_len);
/* Wrap things up */
DAEMON_ENTER ();
......
......@@ -18,10 +18,10 @@ BUILT_SOURCES = \
libgck_la_SOURCES = \
gck-attributes.c gck-attributes.h \
gck-authenticator.c gck-authenticator.h \
gck-certificate.c gck-certificate.h \
gck-certificate-key.c gck-certificate-key.h \
gck-certificate-trust.c gck-certificate-trust.h \
gck-credential.c gck-credential.h \
gck-crypto.c gck-crypto.h \
gck-data-asn1.c gck-data-asn1.h \
gck-data-der.c gck-data-der.h \
......
/*
/*
* gnome-keyring
*
*
* Copyright (C) 2009 Stefan Walter
*
* This program is free software; you can redistribute it and/or modify
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General License for more details.
*
* You should have received a copy of the GNU Lesser General
*
* You should have received a copy of the GNU Lesser General
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
* 02111-1307, USA.
*/
#include "config.h"
#include "gck-attributes.h"
#include "gck-authenticator.h"
#include "gck-credential.h"
#include "gck-secret.h"
#include "gck-session.h"
#include "gck-transaction.h"
......@@ -33,45 +33,45 @@
enum {
PROP_0,
PROP_OBJECT,
PROP_LOGIN,
PROP_SECRET,
PROP_USES_REMAINING
};
struct _GckAuthenticatorPrivate {
struct _GckCredentialPrivate {
/* The object we authenticated */
GckObject *object;
/* Optional login */
GckSecret *login;
/* Optional secret */
GckSecret *secret;
/* Can limit by number of uses remaining */
gint uses_remaining;
};
G_DEFINE_TYPE (GckAuthenticator, gck_authenticator, GCK_TYPE_OBJECT);
G_DEFINE_TYPE (GckCredential, gck_credential, GCK_TYPE_OBJECT);
/* -----------------------------------------------------------------------------
* INTERNAL
* INTERNAL
*/
static void
factory_create_authenticator (GckSession *session, GckTransaction *transaction,
factory_create_credential (GckSession *session, GckTransaction *transaction,
CK_ATTRIBUTE_PTR attrs, CK_ULONG n_attrs, GckObject **result)
{
CK_OBJECT_HANDLE handle;
GckAuthenticator *auth;
GckCredential *auth;
CK_ATTRIBUTE *attr;
GckManager *manager;
GckObject *object;
CK_RV rv;
g_return_if_fail (GCK_IS_TRANSACTION (transaction));
g_return_if_fail (attrs || !n_attrs);
g_return_if_fail (result);
/* The handle is required */
if (!gck_attributes_find_ulong (attrs, n_attrs, CKA_GNOME_OBJECT, &handle)) {
if (!gck_attributes_find_ulong (attrs, n_attrs, CKA_G_OBJECT, &handle)) {
gck_transaction_fail (transaction, CKR_TEMPLATE_INCOMPLETE);
return;
}
......@@ -82,14 +82,14 @@ factory_create_authenticator (GckSession *session, GckTransaction *transaction,
gck_transaction_fail (transaction, rv);
return;
}
/* The value is optional */
attr = gck_attributes_find (attrs, n_attrs, CKA_VALUE);
gck_attributes_consume (attrs, n_attrs, CKA_VALUE, CKA_GNOME_OBJECT, G_MAXULONG);
gck_attributes_consume (attrs, n_attrs, CKA_VALUE, CKA_G_OBJECT, G_MAXULONG);
manager = gck_manager_for_template (attrs, n_attrs, session);
rv = gck_authenticator_create (object, manager,
rv = gck_credential_create (object, manager,
attr ? attr->pValue : NULL,
attr ? attr->ulValueLen : 0, &auth);
if (rv == CKR_OK)
......@@ -99,74 +99,74 @@ factory_create_authenticator (GckSession *session, GckTransaction *transaction,
}
static void
self_destruct (GckAuthenticator *self)
self_destruct (GckCredential *self)
{
GckTransaction *transaction;
CK_RV rv;
g_assert (GCK_IS_AUTHENTICATOR (self));
g_assert (GCK_IS_CREDENTIAL (self));
transaction = gck_transaction_new ();
/* Destroy ourselves */
gck_object_destroy (GCK_OBJECT (self), transaction);
gck_transaction_complete (transaction);
rv = gck_transaction_get_result (transaction);
g_object_unref (transaction);
if (rv != CKR_OK)
g_warning ("Couldn't destroy authenticator object: (code %lu)", (gulong)rv);
g_warning ("Couldn't destroy credential object: (code %lu)", (gulong)rv);
}
static void
object_went_away (gpointer data, GObject *old_object)
{
GckAuthenticator *self = data;
g_return_if_fail (GCK_IS_AUTHENTICATOR (self));
GckCredential *self = data;
g_return_if_fail (GCK_IS_CREDENTIAL (self));
self->pv->object = NULL;
self_destruct (self);
}
/* -----------------------------------------------------------------------------
* OBJECT
* OBJECT
*/
static CK_RV
gck_authenticator_real_get_attribute (GckObject *base, GckSession *session, CK_ATTRIBUTE *attr)
static CK_RV
gck_credential_real_get_attribute (GckObject *base, GckSession *session, CK_ATTRIBUTE *attr)
{
GckAuthenticator *self = GCK_AUTHENTICATOR (base);
GckCredential *self = GCK_CREDENTIAL (base);
switch (attr->type) {
case CKA_CLASS:
return gck_attribute_set_ulong (attr, CKO_GNOME_AUTHENTICATOR);
return gck_attribute_set_ulong (attr, CKO_G_CREDENTIAL);
case CKA_PRIVATE:
return gck_attribute_set_bool (attr, TRUE);
case CKA_GNOME_OBJECT:
case CKA_G_OBJECT:
g_return_val_if_fail (self->pv->object, CKR_GENERAL_ERROR);
return gck_attribute_set_ulong (attr, gck_object_get_handle (self->pv->object));
case CKA_GNOME_USES_REMAINING:
case CKA_G_USES_REMAINING:
if (self->pv->uses_remaining < 0)
return gck_attribute_set_ulong (attr, (CK_ULONG)-1);
else
return gck_attribute_set_ulong (attr, self->pv->uses_remaining);
case CKA_VALUE:
return CKR_ATTRIBUTE_SENSITIVE;
};
return GCK_OBJECT_CLASS (gck_authenticator_parent_class)->get_attribute (base, session, attr);
return GCK_OBJECT_CLASS (gck_credential_parent_class)->get_attribute (base, session, attr);
}
static GObject*
gck_authenticator_constructor (GType type, guint n_props, GObjectConstructParam *props)
static GObject*
gck_credential_constructor (GType type, guint n_props, GObjectConstructParam *props)
{
GckAuthenticator *self = GCK_AUTHENTICATOR (G_OBJECT_CLASS (gck_authenticator_parent_class)->constructor(type, n_props, props));
g_return_val_if_fail (self, NULL);
GckCredential *self = GCK_CREDENTIAL (G_OBJECT_CLASS (gck_credential_parent_class)->constructor(type, n_props, props));
g_return_val_if_fail (self, NULL);
g_return_val_if_fail (self->pv->object, NULL);
......@@ -174,45 +174,45 @@ gck_authenticator_constructor (GType type, guint n_props, GObjectConstructParam
}
static void
gck_authenticator_init (GckAuthenticator *self)
gck_credential_init (GckCredential *self)
{
self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, GCK_TYPE_AUTHENTICATOR, GckAuthenticatorPrivate);
self->pv = G_TYPE_INSTANCE_GET_PRIVATE (self, GCK_TYPE_CREDENTIAL, GckCredentialPrivate);
self->pv->uses_remaining = -1;
}
static void
gck_authenticator_dispose (GObject *obj)
gck_credential_dispose (GObject *obj)
{
GckAuthenticator *self = GCK_AUTHENTICATOR (obj);
GckCredential *self = GCK_CREDENTIAL (obj);
if (self->pv->object)
g_object_weak_unref (G_OBJECT (self->pv->object), object_went_away, self);
self->pv->object = NULL;
if (self->pv->login)
g_object_unref (self->pv->login);
self->pv->login = NULL;
G_OBJECT_CLASS (gck_authenticator_parent_class)->dispose (obj);
if (self->pv->secret)
g_object_unref (self->pv->secret);
self->pv->secret = NULL;
G_OBJECT_CLASS (gck_credential_parent_class)->dispose (obj);
}
static void
gck_authenticator_finalize (GObject *obj)
gck_credential_finalize (GObject *obj)
{
GckAuthenticator *self = GCK_AUTHENTICATOR (obj);
GckCredential *self = GCK_CREDENTIAL (obj);
g_assert (!self->pv->object);
g_assert (!self->pv->login);
g_assert (!self->pv->secret);
G_OBJECT_CLASS (gck_authenticator_parent_class)->finalize (obj);
G_OBJECT_CLASS (gck_credential_parent_class)->finalize (obj);
}
static void
gck_authenticator_set_property (GObject *obj, guint prop_id, const GValue *value,
gck_credential_set_property (GObject *obj, guint prop_id, const GValue *value,
GParamSpec *pspec)
{
GckAuthenticator *self = GCK_AUTHENTICATOR (obj);
GckCredential *self = GCK_CREDENTIAL (obj);
switch (prop_id) {
case PROP_OBJECT:
g_return_if_fail (!self->pv->object);
......@@ -220,8 +220,8 @@ gck_authenticator_set_property (GObject *obj, guint prop_id, const GValue *value
g_return_if_fail (GCK_IS_OBJECT (self->pv->object));
g_object_weak_ref (G_OBJECT (self->pv->object), object_went_away, self);
break;
case PROP_LOGIN:
gck_authenticator_set_login (self, g_value_get_object (value));
case PROP_SECRET:
gck_credential_set_secret (self, g_value_get_object (value));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
......@@ -230,20 +230,20 @@ gck_authenticator_set_property (GObject *obj, guint prop_id, const GValue *value
}
static void
gck_authenticator_get_property (GObject *obj, guint prop_id, GValue *value,
gck_credential_get_property (GObject *obj, guint prop_id, GValue *value,
GParamSpec *pspec)
{
GckAuthenticator *self = GCK_AUTHENTICATOR (obj);
GckCredential *self = GCK_CREDENTIAL (obj);
switch (prop_id) {
case PROP_OBJECT:
g_value_set_object (value, gck_authenticator_get_object (self));
g_value_set_object (value, gck_credential_get_object (self));
break;
case PROP_LOGIN:
g_value_set_object (value, gck_authenticator_get_login (self));
case PROP_SECRET:
g_value_set_object (value, gck_credential_get_secret (self));
break;
case PROP_USES_REMAINING:
g_value_set_int (value, gck_authenticator_get_uses_remaining (self));
g_value_set_int (value, gck_credential_get_uses_remaining (self));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (obj, prop_id, pspec);
......@@ -252,43 +252,43 @@ gck_authenticator_get_property (GObject *obj, guint prop_id, GValue *value,
}
static void
gck_authenticator_class_init (GckAuthenticatorClass *klass)
gck_credential_class_init (GckCredentialClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GckObjectClass *gck_class = GCK_OBJECT_CLASS (klass);
gck_authenticator_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (GckAuthenticatorPrivate));
gobject_class->constructor = gck_authenticator_constructor;
gobject_class->dispose = gck_authenticator_dispose;
gobject_class->finalize = gck_authenticator_finalize;
gobject_class->set_property = gck_authenticator_set_property;
gobject_class->get_property = gck_authenticator_get_property;
gck_class->get_attribute = gck_authenticator_real_get_attribute;
gck_credential_parent_class = g_type_class_peek_parent (klass);
g_type_class_add_private (klass, sizeof (GckCredentialPrivate));
gobject_class->constructor = gck_credential_constructor;
gobject_class->dispose = gck_credential_dispose;
gobject_class->finalize = gck_credential_finalize;
gobject_class->set_property = gck_credential_set_property;
gobject_class->get_property = gck_credential_get_property;
gck_class->get_attribute = gck_credential_real_get_attribute;
g_object_class_install_property (gobject_class, PROP_OBJECT,
g_param_spec_object ("object", "Object", "Object authenticated",
g_param_spec_object ("object", "Object", "Object authenticated",
GCK_TYPE_OBJECT, G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
g_object_class_install_property (gobject_class, PROP_LOGIN,
g_param_spec_object ("login", "Login", "Optiontal login",
g_object_class_install_property (gobject_class, PROP_SECRET,
g_param_spec_object ("secret", "Secret", "Optiontal secret",
GCK_TYPE_SECRET, G_PARAM_READWRITE));
g_object_class_install_property (gobject_class, PROP_USES_REMAINING,
g_param_spec_int ("uses-remaining", "Uses Remaining", "Uses remaining",
-1, G_MAXINT, -1, G_PARAM_READWRITE));
}
/* -----------------------------------------------------------------------------
* PUBLIC
* PUBLIC
*/
GckFactory*
gck_authenticator_get_factory (void)
gck_credential_get_factory (void)
{
static CK_OBJECT_CLASS klass = CKO_GNOME_AUTHENTICATOR;
static CK_OBJECT_CLASS klass = CKO_G_CREDENTIAL;
static CK_ATTRIBUTE attributes[] = {
{ CKA_CLASS, &klass, sizeof (klass) },
......@@ -297,108 +297,107 @@ gck_authenticator_get_factory (void)
static GckFactory factory = {
attributes,
G_N_ELEMENTS (attributes),
factory_create_authenticator
factory_create_credential
};
return &factory;
}
CK_RV
gck_authenticator_create (GckObject *object, GckManager *manager,
CK_UTF8CHAR_PTR pin, CK_ULONG n_pin,
GckAuthenticator **result)
gck_credential_create (GckObject *object, GckManager *manager,
CK_UTF8CHAR_PTR pin, CK_ULONG n_pin,
GckCredential **result)
{
GckAuthenticator *auth;
GckSecret *login = NULL;
GckCredential *auth;
GckSecret *secret = NULL;
CK_RV rv;
g_return_val_if_fail (GCK_IS_OBJECT (object), CKR_GENERAL_ERROR);
g_return_val_if_fail (result, CKR_GENERAL_ERROR);
login = gck_secret_new_from_login (pin, n_pin);
auth = g_object_new (GCK_TYPE_AUTHENTICATOR,
secret = gck_secret_new_from_login (pin, n_pin);
auth = g_object_new (GCK_TYPE_CREDENTIAL,
"module", gck_object_get_module (object),
"manager", manager, "login", login,
"manager", manager, "secret", secret,
"object", object, NULL);
g_object_unref (login);
g_object_unref (secret);
/* Now the unlock must work */
rv = gck_object_unlock (object, auth);
if (rv == CKR_OK)
*result = auth;
else
g_object_unref (auth);
return rv;
}
GckSecret*
gck_authenticator_get_login (GckAuthenticator *self)
gck_credential_get_secret (GckCredential *self)
{
g_return_val_if_fail (GCK_IS_AUTHENTICATOR (self), NULL);
return self->pv->login;
g_return_val_if_fail (GCK_IS_CREDENTIAL (self), NULL);
return self->pv->secret;
}
void
gck_authenticator_set_login (GckAuthenticator *self, GckSecret *login)
gck_credential_set_secret (GckCredential *self, GckSecret *secret)
{
g_return_if_fail (GCK_IS_AUTHENTICATOR (self));
if (login) {
g_return_if_fail (GCK_IS_SECRET (login));
g_object_ref (login);
g_return_if_fail (GCK_IS_CREDENTIAL (self));
if (secret) {
g_return_if_fail (GCK_IS_SECRET (secret));
g_object_ref (secret);
}
if (self->pv->login)
g_object_unref (self->pv->login);
self->pv->login = login;
g_object_notify (G_OBJECT (self), "login");
if (self->pv->secret)
g_object_unref (self->pv->secret);
self->pv->secret = secret;
g_object_notify (G_OBJECT (self), "secret");
}
const gchar*
gck_authenticator_get_password (GckAuthenticator *self, gsize *n_password)
gck_credential_get_password (GckCredential *self, gsize *n_password)
{
g_return_val_if_fail (GCK_IS_AUTHENTICATOR (self), NULL);
g_return_val_if_fail (GCK_IS_CREDENTIAL (self), NULL);
g_return_val_if_fail (n_password, NULL);
if (!self->pv->login) {
if (!self->pv->secret) {
*n_password = 0;
return NULL;
}
return gck_secret_get_password (self->pv->login, n_password);
return gck_secret_get_password (self->pv->secret, n_password);
}
GckObject*
gck_authenticator_get_object (GckAuthenticator *self)
gck_credential_get_object (GckCredential *self)
{
g_return_val_if_fail (GCK_IS_AUTHENTICATOR (self), NULL);
g_return_val_if_fail (GCK_IS_CREDENTIAL (self), NULL);
g_return_val_if_fail (GCK_IS_OBJECT (self->pv->object), NULL);
return self->pv->object;
}
gint
gck_authenticator_get_uses_remaining (GckAuthenticator *self)
gck_credential_get_uses_remaining (GckCredential *self)
{
g_return_val_if_fail (GCK_IS_AUTHENTICATOR (self), 0);
g_return_val_if_fail (GCK_IS_CREDENTIAL (self), 0);
return self->pv->uses_remaining;
}
void
gck_authenticator_set_uses_remaining (GckAuthenticator *self,
gint use_count)
gck_credential_set_uses_remaining (GckCredential *self, gint use_count)
{
g_return_if_fail (GCK_IS_AUTHENTICATOR (self));
g_return_if_fail (GCK_IS_CREDENTIAL (self));
g_return_if_fail (use_count != 0);
self->pv->uses_remaining = use_count;
g_object_notify (G_OBJECT (self), "uses-remaining");
}
void
gck_authenticator_throw_away_one_use (GckAuthenticator *self)
gck_credential_throw_away_one_use (GckCredential *self)
{
g_return_if_fail (GCK_IS_AUTHENTICATOR (self));
g_return_if_fail (GCK_IS_CREDENTIAL (self));
if (self->pv->uses_remaining > 0)
--(self->pv->uses_remaining);
if (self->pv->uses_remaining == 0)
......
/*
/*
* gnome-keyring
*
*
* Copyright (C) 2009 Stefan Walter
*
* This program is free software; you can redistribute it and/or modify
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General License for more details.
*
* You should have received a copy of the GNU Lesser General
*
* You should have received a copy of the GNU Lesser General
* License along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
* 02111-1307, USA.
* 02111-1307, USA.
*/
#ifndef __GCK_AUTHENTICATOR_H__
#define __GCK_AUTHENTICATOR_H__
#ifndef __GCK_CREDENTIAL_H__
#define __GCK_CREDENTIAL_H__
#include <glib-object.h>
#include "gck-object.h"
#include "gck-types.h"
#define GCK_FACTORY_AUTHENTICATOR (gck_authenticator_get_factory ())
#define GCK_FACTORY_CREDENTIAL (gck_credential_get_factory ())
#define GCK_TYPE_AUTHENTICATOR (gck_authenticator_get_type ())
#define GCK_AUTHENTICATOR(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCK_TYPE_AUTHENTICATOR, GckAuthenticator))
#define GCK_AUTHENTICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCK_TYPE_AUTHENTICATOR, GckAuthenticatorClass))
#define GCK_IS_AUTHENTICATOR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCK_TYPE_AUTHENTICATOR))
#define GCK_IS_AUTHENTICATOR_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCK_TYPE_AUTHENTICATOR))
#define GCK_AUTHENTICATOR_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCK_TYPE_AUTHENTICATOR, GckAuthenticatorClass))
#define GCK_TYPE_CREDENTIAL (gck_credential_get_type ())
#define GCK_CREDENTIAL(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GCK_TYPE_CREDENTIAL, GckCredential))
#define GCK_CREDENTIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GCK_TYPE_CREDENTIAL, GckCredentialClass))
#define GCK_IS_CREDENTIAL(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GCK_TYPE_CREDENTIAL))
#define GCK_IS_CREDENTIAL_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GCK_TYPE_CREDENTIAL))
#define GCK_CREDENTIAL_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GCK_TYPE_CREDENTIAL, GckCredentialClass))
typedef struct _GckAuthenticatorClass GckAuthenticatorClass;
typedef struct _GckAuthenticatorPrivate GckAuthenticatorPrivate;
struct _GckAuthenticator {
typedef struct _GckCredentialClass GckCredentialClass;
typedef struct _GckCredentialPrivate GckCredentialPrivate;
struct _GckCredential {
GckObject parent;
GckAuthenticatorPrivate *pv;
GckCredentialPrivate *pv;
};
struct _GckAuthenticatorClass {
struct _GckCredentialClass {
GckObjectClass parent_class;
};
GType gck_authenticator_get_type (void);
GType gck_credential_get_type (void);
GckFactory* gck_authenticator_get_factory (void);
GckFactory* gck_credential_get_factory (void);
CK_RV gck_authenticator_create (GckObject *object,
GckManager *manager,
CK_UTF8CHAR_PTR pin,
CK_ULONG n_pin,
GckAuthenticator **result);
CK_RV gck_credential_create (GckObject *object,