2N/A/* -*- mode: c; c-basic-offset: 4; indent-tabs-mode: nil -*- */
2N/A/*
2N/A * src/lib/krb5/asn.1/asn1_k_encode.h
2N/A *
2N/A * Copyright 1994, 2008 by the Massachusetts Institute of Technology.
2N/A * All Rights Reserved.
2N/A *
2N/A * Export of this software from the United States of America may
2N/A * require a specific license from the United States Government.
2N/A * It is the responsibility of any person or organization contemplating
2N/A * export to obtain such a license before exporting.
2N/A *
2N/A * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and
2N/A * distribute this software and its documentation for any purpose and
2N/A * without fee is hereby granted, provided that the above copyright
2N/A * notice appear in all copies and that both that copyright notice and
2N/A * this permission notice appear in supporting documentation, and that
2N/A * the name of M.I.T. not be used in advertising or publicity pertaining
2N/A * to distribution of the software without specific, written prior
2N/A * permission. Furthermore if you modify this software you must label
2N/A * your software as modified software and not distribute it in such a
2N/A * fashion that it might be confused with the original M.I.T. software.
2N/A * M.I.T. makes no representations about the suitability of
2N/A * this software for any purpose. It is provided "as is" without express
2N/A * or implied warranty.
2N/A */
2N/A
2N/A#ifndef __ASN1_ENCODE_KRB5_H__
2N/A#define __ASN1_ENCODE_KRB5_H__
2N/A
2N/A#include "k5-int.h"
2N/A#include <stdio.h>
2N/A#include "asn1buf.h"
2N/A
2N/A/*
2N/A * **** for simple val's ****
2N/A * asn1_error_code asn1_encode_asn1_type(asn1buf *buf,
2N/A * const krb5_type val,
2N/A * int *retlen);
2N/A * requires *buf is allocated
2N/A * effects Inserts the encoding of val into *buf and
2N/A * returns the length of this encoding in *retlen.
2N/A * Returns ASN1_MISSING_FIELD if a required field is empty in val.
2N/A * Returns ENOMEM if memory runs out.
2N/A *
2N/A * **** for struct val's ****
2N/A * asn1_error_code asn1_encode_asn1_type(asn1buf *buf,
2N/A * const krb5_type *val,
2N/A * int *retlen);
2N/A * requires *buf is allocated
2N/A * effects Inserts the encoding of *val into *buf and
2N/A * returns the length of this encoding in *retlen.
2N/A * Returns ASN1_MISSING_FIELD if a required field is empty in val.
2N/A * Returns ENOMEM if memory runs out.
2N/A *
2N/A * **** for array val's ****
2N/A * asn1_error_code asn1_encode_asn1_type(asn1buf *buf,
2N/A * const krb5_type **val,
2N/A * int *retlen);
2N/A * requires *buf is allocated, **val != NULL, *val[0] != NULL,
2N/A * **val is a NULL-terminated array of pointers to krb5_type
2N/A * effects Inserts the encoding of **val into *buf and
2N/A * returns the length of this encoding in *retlen.
2N/A * Returns ASN1_MISSING_FIELD if a required field is empty in val.
2N/A * Returns ENOMEM if memory runs out.
2N/A */
2N/A
2N/A/* PKINIT */
2N/A
2N/Aasn1_error_code asn1_encode_pk_authenticator(asn1buf *buf,
2N/A const krb5_pk_authenticator *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code
2N/Aasn1_encode_pk_authenticator_draft9(asn1buf *buf,
2N/A const krb5_pk_authenticator_draft9 *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code
2N/Aasn1_encode_algorithm_identifier(asn1buf *buf,
2N/A const krb5_algorithm_identifier *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_subject_pk_info(asn1buf *buf,
2N/A const krb5_subject_pk_info *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_sequence_of_algorithm_identifier(
2N/A asn1buf *buf, const krb5_algorithm_identifier **val, unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_auth_pack(asn1buf *buf, const krb5_auth_pack *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_auth_pack_draft9(asn1buf *buf,
2N/A const krb5_auth_pack_draft9 *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_external_principal_identifier(
2N/A asn1buf *buf, const krb5_external_principal_identifier *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_sequence_of_external_principal_identifier(
2N/A asn1buf *buf, const krb5_external_principal_identifier **val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_pa_pk_as_req(asn1buf *buf,
2N/A const krb5_pa_pk_as_req *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_trusted_ca(asn1buf *buf,
2N/A const krb5_trusted_ca *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_sequence_of_trusted_ca(asn1buf *buf,
2N/A const krb5_trusted_ca **val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code
2N/Aasn1_encode_pa_pk_as_req_draft9(asn1buf *buf,
2N/A const krb5_pa_pk_as_req_draft9 *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_dh_rep_info(asn1buf *buf,
2N/A const krb5_dh_rep_info *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_kdc_dh_key_info(asn1buf *buf,
2N/A const krb5_kdc_dh_key_info *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_reply_key_pack(asn1buf *buf,
2N/A const krb5_reply_key_pack *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code
2N/Aasn1_encode_reply_key_pack_draft9(asn1buf *buf,
2N/A const krb5_reply_key_pack_draft9 *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_pa_pk_as_rep(asn1buf *buf,
2N/A const krb5_pa_pk_as_rep *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code
2N/Aasn1_encode_pa_pk_as_rep_draft9(asn1buf *buf,
2N/A const krb5_pa_pk_as_rep_draft9 *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_td_trusted_certifiers(
2N/A asn1buf *buf, const krb5_external_principal_identifier **val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_typed_data(asn1buf *buf,
2N/A const krb5_typed_data *val,
2N/A unsigned int *retlen);
2N/A
2N/Aasn1_error_code asn1_encode_sequence_of_typed_data(asn1buf *buf,
2N/A const krb5_typed_data **val,
2N/A unsigned int *retlen);
2N/A
2N/A#endif