Finished BLISS signature generation

This commit is contained in:
Andreas Steffen
2014-11-29 14:51:17 +01:00
parent edd72b6bb9
commit e71813e56d
12 changed files with 1178 additions and 165 deletions
@@ -22,6 +22,7 @@
#define BLISS_PUBLIC_KEY_H_
#include <credentials/builder.h>
#include <credentials/cred_encoding.h>
#include <credentials/keys/public_key.h>
typedef struct bliss_public_key_t bliss_public_key_t;
@@ -48,4 +49,47 @@ struct bliss_public_key_t {
*/
bliss_public_key_t *bliss_public_key_load(key_type_t type, va_list args);
/* The following functions are shared with the bliss_private_key class */
/**
* Parse an ASN.1 OCTET STRING into an array of public key coefficients
*
* @param object ASN.1 encoded subjectPublicKey
* @param n number of public key coefficients
* @result coefficients of public key vector
*/
uint32_t* bliss_public_key_from_asn1(chunk_t object, int n);
/**
* Encode a raw BLISS subjectPublicKey in ASN.1 DER format
*
* @param coefficients of public key vector
* @param n number of public key coefficients
* @result ASN.1 encoded subjectPublicKey
*/
chunk_t bliss_public_key_encode(uint32_t *pubkey, int n);
/**
* Encode a BLISS subjectPublicKeyInfo record in ASN.1 DER format
*
* @param oid BLISS public key type OID
* @param pubkey coefficients of public key vector
* @param n number of public key coefficients
* @result ASN.1 encoded subjectPublicKeyInfo record
*/
chunk_t bliss_public_key_info_encode(int oid, uint32_t *pubkey, int n);
/**
* Generate a BLISS public key fingerprint
*
* @param oid BLISS public key type OID
* @param pubkey coefficients of public key vector
* @param n number of public key coefficients
* @param type type of fingerprint to be generated
* @param fp generated fingerprint (must be freed by caller)
* @result TRUE if generation was successful
*/
bool bliss_public_key_fingerprint(int oid, uint32_t *pubkey, int n,
cred_encoding_type_t type, chunk_t *fp);
#endif /** BLISS_PUBLIC_KEY_H_ @}*/