~ubuntu-branches/ubuntu/raring/gnutls26/raring

« back to all changes in this revision

Viewing changes to lib/x509/pkcs7.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-20 13:07:18 UTC
  • mfrom: (12.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110520130718-db41dybbanzfvlji
Tags: 2.10.5-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Fix build failure with --no-add-needed.
  - Build for multiarch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright (C) 2003, 2004, 2005, 2008, 2009 Free Software Foundation
 
2
 * Copyright (C) 2003, 2004, 2005, 2008, 2009, 2010 Free Software
 
3
 * Foundation, Inc.
3
4
 *
4
5
 * Author: Nikos Mavrogiannopoulos
5
6
 *
6
 
 * This file is part of GNUTLS.
 
7
 * This file is part of GnuTLS.
7
8
 *
8
 
 * The GNUTLS library is free software; you can redistribute it and/or
 
9
 * The GnuTLS is free software; you can redistribute it and/or
9
10
 * modify it under the terms of the GNU Lesser General Public License
10
11
 * as published by the Free Software Foundation; either version 2.1 of
11
12
 * the License, or (at your option) any later version.
138
139
}
139
140
 
140
141
/**
141
 
 * gnutls_pkcs7_init - initialize a #gnutls_pkcs7_t structure
 
142
 * gnutls_pkcs7_init:
142
143
 * @pkcs7: The structure to be initialized
143
144
 *
144
145
 * This function will initialize a PKCS7 structure. PKCS7 structures
170
171
}
171
172
 
172
173
/**
173
 
 * gnutls_pkcs7_deinit - deinitializes a #gnutls_pkcs7_t structure
 
174
 * gnutls_pkcs7_deinit:
174
175
 * @pkcs7: The structure to be initialized
175
176
 *
176
177
 * This function will deinitialize a PKCS7 structure.
188
189
}
189
190
 
190
191
/**
191
 
 * gnutls_pkcs7_import - import a DER or PEM encoded PKCS7
 
192
 * gnutls_pkcs7_import:
192
193
 * @pkcs7: The structure to store the parsed PKCS7.
193
194
 * @data: The DER or PEM encoded PKCS7.
194
195
 * @format: One of DER or PEM
195
196
 *
196
197
 * This function will convert the given DER or PEM encoded PKCS7 to
197
198
 * the native #gnutls_pkcs7_t format.  The output will be stored in
198
 
 * 'pkcs7'.
 
199
 * @pkcs7.
199
200
 *
200
201
 * If the PKCS7 is PEM encoded it should have a header of "PKCS7".
201
202
 *
259
260
}
260
261
 
261
262
/**
262
 
 * gnutls_pkcs7_get_crt_raw - get a certificate from a PKCS7 certificate set
 
263
 * gnutls_pkcs7_get_crt_raw:
263
264
 * @pkcs7: should contain a gnutls_pkcs7_t structure
264
265
 * @indx: contains the index of the certificate to extract
265
266
 * @certificate: the contents of the certificate will be copied
368
369
}
369
370
 
370
371
/**
371
 
 * gnutls_pkcs7_get_crt_count - return the number of certificates in a PKCS7 certificate set
 
372
 * gnutls_pkcs7_get_crt_count:
372
373
 * @pkcs7: should contain a #gnutls_pkcs7_t structure
373
374
 *
374
375
 * This function will return the number of certifcates in the PKCS7
412
413
}
413
414
 
414
415
/**
415
 
 * gnutls_pkcs7_export - export the pkcs7 structure
 
416
 * gnutls_pkcs7_export:
416
417
 * @pkcs7: Holds the pkcs7 structure
417
418
 * @format: the format of output params. One of PEM or DER.
418
419
 * @output_data: will contain a structure PEM or DER encoded
523
524
}
524
525
 
525
526
/**
526
 
 * gnutls_pkcs7_set_crt_raw - add a certificate in a PKCS7 certificate set
 
527
 * gnutls_pkcs7_set_crt_raw:
527
528
 * @pkcs7: should contain a #gnutls_pkcs7_t structure
528
529
 * @crt: the DER encoded certificate to be added
529
530
 *
617
618
}
618
619
 
619
620
/**
620
 
  * gnutls_pkcs7_set_crt - add a parsed certificate in a PKCS7 certificate set
621
 
  * @pkcs7: should contain a #gnutls_pkcs7_t structure
622
 
  * @crt: the certificate to be copied.
623
 
  *
624
 
  * This function will add a parsed certificate to the PKCS7 or
625
 
  * RFC2630 certificate set.  This is a wrapper function over
626
 
  * gnutls_pkcs7_set_crt_raw() .
627
 
  *
628
 
  * Returns: On success, %GNUTLS_E_SUCCESS is returned, otherwise a
629
 
  *   negative error value.
630
 
  **/
 
621
 * gnutls_pkcs7_set_crt:
 
622
 * @pkcs7: should contain a #gnutls_pkcs7_t structure
 
623
 * @crt: the certificate to be copied.
 
624
 *
 
625
 * This function will add a parsed certificate to the PKCS7 or
 
626
 * RFC2630 certificate set.  This is a wrapper function over
 
627
 * gnutls_pkcs7_set_crt_raw() .
 
628
 *
 
629
 * Returns: On success, %GNUTLS_E_SUCCESS is returned, otherwise a
 
630
 *   negative error value.
 
631
 **/
631
632
int
632
633
gnutls_pkcs7_set_crt (gnutls_pkcs7_t pkcs7, gnutls_x509_crt_t crt)
633
634
{
659
660
 
660
661
 
661
662
/**
662
 
 * gnutls_pkcs7_delete_crt - deletes a certificate from a PKCS7 certificate set
 
663
 * gnutls_pkcs7_delete_crt:
663
664
 * @pkcs7: should contain a gnutls_pkcs7_t structure
664
665
 * @indx: the index of the certificate to delete
665
666
 *
725
726
 */
726
727
 
727
728
/**
728
 
 * gnutls_pkcs7_get_crl_raw - returns a crl in a PKCS7 crl set
 
729
 * gnutls_pkcs7_get_crl_raw:
729
730
 * @pkcs7: should contain a #gnutls_pkcs7_t structure
730
731
 * @indx: contains the index of the crl to extract
731
732
 * @crl: the contents of the crl will be copied there (may be null)
802
803
}
803
804
 
804
805
/**
805
 
 * gnutls_pkcs7_get_crl_count - returns the number of CRLs in a PKCS7 crl set
 
806
 * gnutls_pkcs7_get_crl_count:
806
807
 * @pkcs7: should contain a gnutls_pkcs7_t structure
807
808
 *
808
809
 * This function will return the number of certifcates in the PKCS7
846
847
}
847
848
 
848
849
/**
849
 
 * gnutls_pkcs7_set_crl_raw - add a crl in a PKCS7 crl set
 
850
 * gnutls_pkcs7_set_crl_raw:
850
851
 * @pkcs7: should contain a #gnutls_pkcs7_t structure
851
852
 * @crl: the DER encoded crl to be added
852
853
 *
929
930
}
930
931
 
931
932
/**
932
 
 * gnutls_pkcs7_set_crl - add a parsed crl in a PKCS7 crl set
 
933
 * gnutls_pkcs7_set_crl:
933
934
 * @pkcs7: should contain a #gnutls_pkcs7_t structure
934
935
 * @crl: the DER encoded crl to be added
935
936
 *
969
970
}
970
971
 
971
972
/**
972
 
 * gnutls_pkcs7_delete_crl - deletes a CRL from a PKCS7 crl set
 
973
 * gnutls_pkcs7_delete_crl:
973
974
 * @pkcs7: should contain a #gnutls_pkcs7_t structure
974
975
 * @indx: the index of the crl to delete
975
976
 *