EN JA
hx509 certificate functions(3)
hx509 certificate functions(3) Heimdalx509library hx509 certificate functions(3)

名称

hx509 証明書関数-

関数


int hx509_cert_init (hx509_context context, const Certificate *c, hx509_cert *cert)
 
int hx509_cert_init_data (hx509_context context, const void *ptr, size_t len, hx509_cert *cert)
 
void hx509_cert_free (hx509_cert cert)
 
hx509_cert hx509_cert_ref (hx509_cert cert)
 
void hx509_verify_ctx_f_allow_default_trustanchors (hx509_verify_ctx ctx, int boolean)
 
int hx509_cert_find_subjectAltName_otherName (hx509_context context, hx509_cert cert, const heim_oid *oid, hx509_octet_string_list *list)
 
int hx509_cert_cmp (hx509_cert p, hx509_cert q)
 
int hx509_cert_get_issuer (hx509_cert p, hx509_name *name)
 
int hx509_cert_get_subject (hx509_cert p, hx509_name *name)
 
int hx509_cert_get_base_subject (hx509_context context, hx509_cert c, hx509_name *name)
 
int hx509_cert_get_serialnumber (hx509_cert p, heim_integer *i)
 
time_t hx509_cert_get_notBefore (hx509_cert p)
 
time_t hx509_cert_get_notAfter (hx509_cert p)
 
int hx509_cert_get_SPKI (hx509_context context, hx509_cert p, SubjectPublicKeyInfo *spki)
 
int hx509_cert_get_SPKI_AlgorithmIdentifier (hx509_context context, hx509_cert p, AlgorithmIdentifier *alg)
 
int hx509_cert_get_issuer_unique_id (hx509_context context, hx509_cert p, heim_bit_string *issuer)
 
int hx509_cert_get_subject_unique_id (hx509_context context, hx509_cert p, heim_bit_string *subject)
 
int hx509_verify_hostname (hx509_context context, const hx509_cert cert, int flags, hx509_hostname_type type, const char *hostname, const struct sockaddr *sa, int sa_size)
 
hx509_cert_attribute hx509_cert_get_attribute (hx509_cert cert, const heim_oid *oid)
 
int hx509_cert_set_friendly_name (hx509_cert cert, const char *name)
 
const char * hx509_cert_get_friendly_name (hx509_cert cert)
 
int hx509_query_alloc (hx509_context context, hx509_query **q)
 
void hx509_query_match_option (hx509_query *q, hx509_query_option option)
 
int hx509_query_match_issuer_serial (hx509_query *q, const Name *issuer, const heim_integer *serialNumber)
 
int hx509_query_match_friendly_name (hx509_query *q, const char *name)
 
int hx509_query_match_eku (hx509_query *q, const heim_oid *eku)
 
int hx509_query_match_cmp_func (hx509_query *q, int(*func)(hx509_context, hx509_cert, void *), void *ctx)
 
void hx509_query_free (hx509_context context, hx509_query *q)
 
void hx509_query_statistic_file (hx509_context context, const char *fn)
 
void hx509_query_unparse_stats (hx509_context context, int printtype, FILE *out)
 
int hx509_cert_check_eku (hx509_context context, hx509_cert cert, const heim_oid *eku, int allow_any_eku)
 
int hx509_cert_binary (hx509_context context, hx509_cert c, heim_octet_string *os)
 
int hx509_print_cert (hx509_context context, hx509_cert cert, FILE *out)
 

詳細説明

説明と実行例については、 基本的な証明書を参照してください。

関数説明

int hx509_cert_binary (hx509_context context, hx509_cert c, heim_octet_string * os)

DER エンコードバイナリとして hx509 証明書をエンコードします。

パラメータ:

context hx509 コンテキスト。
 
c エンコードする証明書。
 
os エンコード証明書、NULL に設定する、エラーの場合、0。 hx509_xfree() で os->data を解放します。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_cert_check_eku (hx509_context context, hx509_cert cert, const heim_oid * eku, int allow_any_eku)

hx509 証明書で拡張されたキー使用法をチェックします。

パラメータ:

context hx509 コンテキスト。
 
cert hx509 コンテキスト。
 
eku チェックする EKU。
 
allow_any_eku 任意の EKU が設定されているなら、置換されることを可能にします。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_cert_cmp (hx509_cert p, hx509_cert q)

ソートに役に立つ、hx509 証明書オブジェクトを比較します。

パラメータ:

p hx509 証明書オブジェクト。
 
q hx509 証明書オブジェクト。

返り値:

0、オブジェクトが同じです、p が q より '大きい' なら > 0 を返し、 p が q より '小さい' なら < 0 を返します。

 

int hx509_cert_find_subjectAltName_otherName (hx509_context context, hx509_cert cert, const heim_oid * oid, hx509_octet_string_list * list)

証明書の oid によって指定された subjectAltNames のリストを返します。エラーの場合、

オクテット文字列のリストを返します、 hx509_free_octet_string_list() で解放されるべきです。

パラメータ:

context hx509 コンテキスト。
 
cert hx509 証明書オブジェクト。
 
oid SubjectAltName のための oid。
 
list SubjectAltName と一致するリスト。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

void hx509_cert_free (hx509_cert cert)

hx509 証明書オブジェクトへの参照を解放します、 refcounter が 0 に達するなら、オブジェクトは、解放されます。 NULL を渡すことも許可されます。

パラメータ:

cert 解放する cert。

 

hx509_cert_attribute hx509_cert_get_attribute (hx509_cert cert, const heim_oid * oid)

証明書のために外部属性を取得します、例は、フレンドリ名と id です。

パラメータ:

cert 検索する hx509 証明書オブジェクト。
 
oid 検索する oid。

返り値:

hx509_cert_attribute、証明書が参照される限りは有効。

 

int hx509_cert_get_base_subject (hx509_context context, hx509_cert c, hx509_name * name)

hx509 証明書の基本の subject の名前を返します。証明書が検証された代理証明書であるなら、この関数は、基本の証明書 (代理チェーンのルート) を返します。代理証明書が基本の証明書で検証されないなら、 HX509_PROXY_CERTIFICATE_NOT_CANONICALIZED が返されます。

パラメータ:

context hx509 コンテキスト。
 
c hx509 証明書オブジェクト。
 
name hx509 名へのポインタ、 hx509_name_free() によって解放されるべきです。また、 hx509_cert_get_subject() を参照してください。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

const char* hx509_cert_get_friendly_name (hx509_cert cert)

証明書のフレンドリ名を取得します。

パラメータ:

cert フレンドリ名を取得する cert。

返り値:

あるなら、フレンドリ名または NULL。フレンドリ名は、証明書が参照されている限り有効です。

 

int hx509_cert_get_issuer (hx509_cert p, hx509_name * name)

hx509 証明書の発行者の名前を返します。

パラメータ:

p hx509 証明書オブジェクト。
 
name hx509 名へのポインタ、 hx509_name_free() によって解放されるべきです。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_cert_get_issuer_unique_id (hx509_context context, hx509_cert p, heim_bit_string * issuer)

Issuer Unique ID (発行者のユニークな ID) のコピーを取得します。

パラメータ:

context hx509_context。
 
p hx509 証明書。
 
issuer 発行者の ID を返します、der_free_bit_string() で解放します。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。証明書に issuerUniqueID がないなら、エラーコード HX509_EXTENSION_NOT_FOUND が返されます。

 

time_t hx509_cert_get_notAfter (hx509_cert p)

証明書の notAfter 時間を取得します。

パラメータ:

p hx509 証明書オブジェクト。

返り値:

not after time を返します。

 

time_t hx509_cert_get_notBefore (hx509_cert p)

証明書の notBefore 時間を取得します。

パラメータ:

p hx509 証明書オブジェクト。

返り値:

not before time を返します。

 

int hx509_cert_get_serialnumber (hx509_cert p, heim_integer * i)

証明書のシリアル番号を取得します。

パラメータ:

p hx509 証明書オブジェクト。
 
i シリアル番号、der_free_heim_integer() で解放されるべきです。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_cert_get_SPKI (hx509_context context, hx509_cert p, SubjectPublicKeyInfo * spki)

hx509 証明書から SubjectPublicKeyInfo 構造体を取得する。

パラメータ:

context hx509 コンテキスト。
 
p hx509 証明書オブジェクト。
 
spki SubjectPublicKeyInfo、free_SubjectPublicKeyInfo() で解放されるべきです。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_cert_get_SPKI_AlgorithmIdentifier (hx509_context context, hx509_cert p, AlgorithmIdentifier * alg)

hx509 証明書から AlgorithmIdentifier を取得します。

パラメータ:

context hx509 コンテキスト。
 
p hx509 証明書オブジェクト。
 
alg AlgorithmIdentifier、free_AlgorithmIdentifier() で解放されるべきです。 Algorithmidentifier は、典型的に rsaEncryption、id-ecPublicKey または他のある公開鍵メカニズムです。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_cert_get_subject (hx509_cert p, hx509_name * name)

hx509 証明書の subject の名前を返します。

パラメータ:

p hx509 証明書オブジェクト。
 
name hx509 名へのポインタ、 hx509_name_free() によって解放されるべきです。また、 hx509_cert_get_base_subject() を参照してください。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_cert_get_subject_unique_id (hx509_context context, hx509_cert p, heim_bit_string * subject)

Subect Unique ID のコピーを取得する。

パラメータ:

context hx509_context。
 
p a hx509 証明書。
 
subject 返された subject id、der_free_bit_string() で解放します。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。証明書に subjectUniqueID がないなら、ラーコード HX509_EXTENSION_NOT_FOUND が返されます。

 

int hx509_cert_init (hx509_context context, const Certificate * c, hx509_cert * cert)

デコードされた証明書から hx509 証明書オブジェクトを割り付けて、初期化します。

パラメータ:

context hx509 コンテキスト。
 
c
 
cert

返り値:

hx509 エラーコードを返します。

 

int hx509_cert_init_data (hx509_context context, const void * ptr, size_t len, hx509_cert * cert)

ちょうど hx509_cert_init() に似ていますが、デコード証明書の代わりに、 DER/BER エンコードされた証明書を含むメモリ領域へのポインタと長さを取ります。

メモリ領域が単なる証明書とその他を含んでいなければ、関数は、 HX509_EXTRA_DATA_AFTER_STRUCTURE で失敗します。

パラメータ:

context hx509 コンテキスト。
 
ptr エンコードされた証明書を含んでいるメモリ領域へのポインタ。
 
len メモリ領域の長さ。
 
cert hx509 証明書オブジェクトへのポインタを返します、エラーで NULL を含みます。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

hx509_cert hx509_cert_ref (hx509_cert cert)

hx509 証明書オブジェクトに参照を追加します。

パラメータ:

cert hx509 証明書オブジェクトへのポインタ。

返り値:

渡されるのと同じオブジェクト。

 

int hx509_cert_set_friendly_name (hx509_cert cert, const char * name)

証明書でフレンドリ名を設定します。

パラメータ:

cert フレンドリ名に設定する証明書。
 
name フレンドリ名。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_print_cert (hx509_context context, hx509_cert cert, FILE * out)

証明書の単純な表現を印刷します。

パラメータ:

context hx509 コンテキスト、NULL であるかもしれません。
 
cert 印刷する証明書。
 
out stdio 出力ストリーム、NULL であるなら、stdout が使用されます。

返り値:

hx509 エラーコード。

 

int hx509_query_alloc (hx509_context context, hx509_query ** q)

問い合わせコントローラを割り付けます。 hx509_query_free() を使用して解放します。

パラメータ:

context hx509 コンテキスト。
 
q hx509_query へのポインタを返します。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

void hx509_query_free (hx509_context context, hx509_query * q)

問い合わせコントローラを解放します。

パラメータ:

context hx509 コンテキスト。
 
q 問い合わせコントローラへのポインタ。

 

int hx509_query_match_cmp_func (hx509_query * q, int(*)(hx509_context, hx509_cert, void *) func, void * ctx)

特定の比較関数を使用して比較する問い合わせコントローラを設定します。

パラメータ:

q hx509 問い合わせコントローラ。
 
func 比較のために使用する関数。引数が NULL であるなら、比較関数は、削除されます。
 
ctx 関数に渡されるコンテキスト。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_query_match_eku (hx509_query * q, const heim_oid * eku)

1 つの特定の EKU (拡張キー使用法) 要求する問い合わせコントローラを設定します。あらゆる以前の EKU のマッチを上書きします。 NULL が eku として渡されるなら、EKU 要求は、リセットされます。

パラメータ:

q hx509 問い合わせコントローラ。
 
eku マッチする EKU。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_query_match_friendly_name (hx509_query * q, const char * name)

フレンドリ名で比較する問い合わせコントローラを設定します。

パラメータ:

q hx509 問い合わせコントローラ。
 
name 比較するフレンドリ名。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_query_match_issuer_serial (hx509_query * q, const Name * issuer, const heim_integer * serialNumber)

問い合わせコントローラの比較の発行者とシリアル番号を設定します。関数は、発行者とシリアル番号のコピーを行います。

パラメータ:

q hx509 問い合わせコントローラ。
 
issuer 検索する発行者。
 
serialNumber 発行者の serialNumber。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

void hx509_query_match_option (hx509_query * q, hx509_query_option option)

hx509 問い合わせコントローラのための比較オプションを設定します。

パラメータ:

q 問い合わせコントローラ。
 
option 問い合わせコントローラを制御するオプション。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

void hx509_query_statistic_file (hx509_context context, const char * fn)

問い合わせ統計のための統計ファイルを設定します。

パラメータ:

context hx509 コンテキスト。
 
fn 統計ファイル名。

 

void hx509_query_unparse_stats (hx509_context context, int printtype, FILE * out)

統計ファイルを非解析 (unparse) し、FILE 記述子で結果を印刷します。

パラメータ:

context hx509 コンテキスト。
 
printtype 印刷するタイプ。
 
out データを書き込む FILE。

 

void hx509_verify_ctx_f_allow_default_trustanchors (hx509_verify_ctx ctx, int boolean)

他の信頼アンカが設定されないなら、オペレーティングシステムの組み込み信頼アンカを使用することを許可します。

パラメータ:

ctx 検証コンテキスト。
 
boolean 0 でないなら、オペレーティングシステムの組み込み信頼アンカを使用します。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 

int hx509_verify_hostname (hx509_context context, const hx509_cert cert, int flags, hx509_hostname_type type, const char * hostname, const struct sockaddr * sa, int sa_size)

ホスト名とアドレスのために証明書が使用されのを許可されているかを検証します。

パラメータ:

context hx509 コンテキスト。
 
cert 比較する証明書。
 
flags 振る舞いを修正するフラグは、次の通りです:
HX509_VHN_F_ALLOW_NO_MATCH 比較は ok ではありません。

 

type ホスト名のタイプは、次の通りです:

HX509_HN_HOSTNAME プレーン (plain) なホスト名に対して。
HX509_HN_DNSSRV DNS SRV 名に対して。

 

hostname チェックするホスト名。

 

sa ホストのアドレス。

 

sa_size アドレスの長さ。

返り値:

hx509 エラーコード、 hx509_get_error_string() を参照。

 
11 Jan 2012 Version 1.5.2