Remove unused monolithic PKCS#7 code

This commit is contained in:
Martin Willi 2012-11-28 12:44:05 +01:00
parent 74cc41c704
commit 1865fb929a
4 changed files with 3 additions and 1241 deletions

View File

@ -7,7 +7,7 @@ library.c \
asn1/asn1.c asn1/asn1_parser.c asn1/oid.c bio/bio_reader.c bio/bio_writer.c \
collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \
collections/linked_list.c \
crypto/crypters/crypter.c crypto/hashers/hasher.c crypto/pkcs7.c crypto/pkcs9.c \
crypto/crypters/crypter.c crypto/hashers/hasher.c \
crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
crypto/prfs/prf.c crypto/prfs/mac_prf.c \
crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \

View File

@ -5,7 +5,7 @@ library.c \
asn1/asn1.c asn1/asn1_parser.c asn1/oid.c bio/bio_reader.c bio/bio_writer.c \
collections/blocking_queue.c collections/enumerator.c collections/hashtable.c \
collections/linked_list.c \
crypto/crypters/crypter.c crypto/hashers/hasher.c crypto/pkcs7.c crypto/pkcs9.c \
crypto/crypters/crypter.c crypto/hashers/hasher.c crypto/pkcs9.c \
crypto/proposal/proposal_keywords.c crypto/proposal/proposal_keywords_static.c \
crypto/prfs/prf.c crypto/prfs/mac_prf.c \
crypto/rngs/rng.c crypto/prf_plus.c crypto/signers/signer.c \
@ -41,7 +41,7 @@ asn1/asn1.h asn1/asn1_parser.h asn1/oid.h bio/bio_reader.h bio/bio_writer.h \
collections/blocking_queue.h collections/enumerator.h collections/hashtable.h \
collections/linked_list.h \
crypto/crypters/crypter.h crypto/hashers/hasher.h crypto/mac.h \
crypto/pkcs7.h crypto/pkcs9.h crypto/proposal/proposal_keywords.h \
crypto/pkcs9.h crypto/proposal/proposal_keywords.h \
crypto/proposal/proposal_keywords_static.h \
crypto/prfs/prf.h crypto/prfs/mac_prf.h crypto/rngs/rng.h crypto/nonce_gen.h \
crypto/prf_plus.h crypto/signers/signer.h crypto/signers/mac_signer.h \

File diff suppressed because it is too large Load Diff

View File

@ -1,178 +0,0 @@
/*
* Copyright (C) 2005 Jan Hutter, Martin Willi
* Copyright (C) 2002-2008 Andreas Steffen
* Hochschule fuer Technik Rapperswil, Switzerland
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
*
* 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 General Public License
* for more details.
*/
/**
* @defgroup pkcs7 pkcs7
* @{ @ingroup crypto
*/
#ifndef PKCS7_H_
#define PKCS7_H_
typedef struct pkcs7_t pkcs7_t;
#include <library.h>
#include <credentials/keys/private_key.h>
#include <crypto/pkcs9.h>
#include <crypto/crypters/crypter.h>
#include <collections/enumerator.h>
/**
* PKCS#7 contentInfo object.
*/
struct pkcs7_t {
/**
* Check if the PKCS#7 contentType is data
*
* @return TRUE if the contentType is data
*/
bool (*is_data) (pkcs7_t *this);
/**
* Check if the PKCS#7 contentType is signedData
*
* @return TRUE if the contentType is signedData
*/
bool (*is_signedData) (pkcs7_t *this);
/**
* Check if the PKCS#7 contentType is envelopedData
*
* @return TRUE if the contentType is envelopedData
*/
bool (*is_envelopedData) (pkcs7_t *this);
/**
* Parse a PKCS#7 data content.
*
* @return TRUE if parsing was successful
*/
bool (*parse_data) (pkcs7_t *this);
/**
* Parse a PKCS#7 signedData content. The contained PKCS#7 data is parsed
* and verified.
*
* @param cacert cacert used to verify the signature
* @return TRUE if parsing was successful
*/
bool (*parse_signedData) (pkcs7_t *this, certificate_t *cacert);
/**
* Parse a PKCS#7 envelopedData content.
*
* @param serialNumber serialNumber of the request
* @param key private key used to decrypt the symmetric key
* @return TRUE if parsing was successful
*/
bool (*parse_envelopedData) (pkcs7_t *this, chunk_t serialNumber,
private_key_t *key);
/**
* Returns the parsed data object
*
* @return chunk containing the data object
*/
chunk_t (*get_data) (pkcs7_t *this);
/**
* Returns the a DER-encoded contentInfo object
*
* @return chunk containing the contentInfo object
*/
chunk_t (*get_contentInfo) (pkcs7_t *this);
/**
* Create an enumerator for the certificates.
*
* @return enumerator for the certificates
*/
enumerator_t *(*create_certificate_enumerator) (pkcs7_t *this);
/**
* Add a certificate.
*
* @param cert certificate to be included (gets adopted)
*/
void (*set_certificate) (pkcs7_t *this, certificate_t *cert);
/**
* Add authenticated attributes.
*
* @param attributes attributes to be included (gets adopted)
*/
void (*set_attributes) (pkcs7_t *this, pkcs9_t *attributes);
/**
* Get attributes.
*
* @return attributes (internal data)
*/
pkcs9_t *(*get_attributes) (pkcs7_t *this);
/**
* Build a data object
*
* @return TRUE if build was successful
*/
bool (*build_data) (pkcs7_t *this);
/**
* Build an envelopedData object
*
* @param cert receivers's certificate
* @param alg encryption algorithm
* @param key_size key size to use
* @return TRUE if build was successful
*/
bool (*build_envelopedData) (pkcs7_t *this, certificate_t *cert,
encryption_algorithm_t alg, size_t key_size);
/**
* Build an signedData object
*
* @param key signer's private key
* @param alg digest algorithm used for signature
* @return TRUE if build was successful
*/
bool (*build_signedData) (pkcs7_t *this, private_key_t *key,
hash_algorithm_t alg);
/**
* Destroys the contentInfo object.
*/
void (*destroy) (pkcs7_t *this);
};
/**
* Read a PKCS#7 contentInfo object from a DER encoded chunk.
*
* @param chunk chunk containing DER encoded data
* @param level ASN.1 parsing start level
* @return created pkcs7_contentInfo object, or NULL if invalid.
*/
pkcs7_t *pkcs7_create_from_chunk(chunk_t chunk, u_int level);
/**
* Create a PKCS#7 contentInfo object
*
* @param data chunk containing data
* @return created pkcs7_contentInfo object.
*/
pkcs7_t *pkcs7_create_from_data(chunk_t data);
#endif /** PKCS7_H_ @}*/